<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jca</id>
	<title>Rsewiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jca"/>
	<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Special:Contributions/Jca"/>
	<updated>2026-05-25T08:50:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8792</id>
		<title>Robobot MQTT topics</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8792"/>
		<updated>2026-05-15T15:18:11Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Command topics from Teensy_interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot_B| Robobot]]&lt;br /&gt;
&lt;br /&gt;
== MQTT ==&lt;br /&gt;
&lt;br /&gt;
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol for transporting messages between processes and across networks.&lt;br /&gt;
&lt;br /&gt;
The used MQTT server is Mosquitto from https://mosquitto.org/&lt;br /&gt;
&lt;br /&gt;
The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html&lt;br /&gt;
&lt;br /&gt;
Mosquitto comes with commands for &#039;&#039;publish&#039;&#039; and subscribe directly from the command line, e.g.:&lt;br /&gt;
&lt;br /&gt;
 mosquitto_pub -h 10.197.218.81 -t dtubot/cmd/T0 -m &amp;quot;sub ir 300&amp;quot;&lt;br /&gt;
 mosquitto_sub -h 10.197.218.81 -v -t dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The used options are: &#039;&#039;-h&#039;&#039; for host, &#039;&#039;-t&#039;&#039; for topic and &#039;&#039;-m&#039;&#039; for message.&lt;br /&gt;
&lt;br /&gt;
Many other MQTT apps can be used too.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MQTT-explorer&#039;&#039; is recommended and available on all platforms. see: http://mqtt-explorer.com/&lt;br /&gt;
&lt;br /&gt;
[[file: mqtt-server-with-app.png | 770px]]&lt;br /&gt;
&lt;br /&gt;
MQTT message flow and power off. MQTT Explorer can explore messages. The &#039;&#039;ip_display&#039;&#039; does not display the IP address; it is handled by the &#039;&#039;teensy_interface&#039;&#039; (legacy names). The &#039;&#039;Start&#039;&#039; button starts the Python mission app. All receive the shutdown (&amp;gt;5 sec on &#039;Start&#039;). The Teensy is told to cut power in 20 seconds to allow the Raspberry to shut down.&lt;br /&gt;
&lt;br /&gt;
== Robobot ==&lt;br /&gt;
&lt;br /&gt;
Robobot uses MQTT &lt;br /&gt;
&lt;br /&gt;
[[file:robobot-mqtt-2025.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The MQTT server connects the Teensy_interface with the behaviour part of the robot.&lt;br /&gt;
&lt;br /&gt;
=== Data topics (from firmware) ===&lt;br /&gt;
&lt;br /&gt;
Data messages mainly originate from the Teensy firmware, where they can be subscribed to.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/#&lt;br /&gt;
&lt;br /&gt;
All used topics start with the keyword &amp;lt;code&amp;gt;dtubot/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; is a wildcard that matches all sub-topics.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The sub-topic &amp;lt;code&amp;gt;dtubot/drive/&amp;lt;/code&amp;gt; is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy &amp;lt;code&amp;gt;T0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Data messages ====&lt;br /&gt;
&lt;br /&gt;
Data types described in [[Help page Teensy_8]] generate messages starting with a keyword and some parameters. &lt;br /&gt;
The keyword is used as a subtopic, e.g.:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose    is a pose message&lt;br /&gt;
&lt;br /&gt;
The parameters are then the MQTT message &amp;quot;payload&amp;quot;,&lt;br /&gt;
examples of a pose message are:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241&lt;br /&gt;
&lt;br /&gt;
After the topic &#039;&#039;dtubot/drive/T0/pose&#039;&#039; is the payload.&lt;br /&gt;
&lt;br /&gt;
The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).&lt;br /&gt;
&lt;br /&gt;
In this case, the remaining data are Teensy time (sec), x- and y-positions, heading (radians), and tilt (radians).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.7999 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587&lt;br /&gt;
 dtubot/drive/T0/current 1738930269.8004 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/dist    1738930269.8027 0.623 0.469&lt;br /&gt;
 dtubot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.8073 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241&lt;br /&gt;
 dtubot/drive/T0/conf    1738499287.6484 0.0750 0.0750 19.000 68 0.2300 0.0020 0&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597&lt;br /&gt;
 dtubot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23&lt;br /&gt;
&lt;br /&gt;
Most parameters are numeric but may contain text, as in the last message.&lt;br /&gt;
&lt;br /&gt;
At times, the Teensy sends a comment or a debug message. Such messages are sent with the &#039;&#039;info&#039;&#039; topic. A &#039;&#039;#&#039;&#039; always precedes the data in the payload.&lt;br /&gt;
&lt;br /&gt;
== Command topics from Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
The teensy interface can publish messages related to its own state, such as:&lt;br /&gt;
 dtubot/drive/gnss        &amp;lt;time&amp;gt; &amp;lt;lat&amp;gt; &amp;lt;long&amp;gt; &amp;lt;speed&amp;gt; &amp;lt;sats&amp;gt; &amp;lt;dop&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/axis    &amp;lt;time&amp;gt; &amp;lt;axis1&amp;gt; &amp;lt;axis2&amp;gt; ... &amp;lt;axis8&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/buttons &amp;lt;time&amp;gt; &amp;lt;but1&amp;gt; &amp;lt;but2&amp;gt; ... &amp;lt;but11&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/state   &amp;lt;time&amp;gt; &amp;lt;manual&amp;gt; &amp;lt;linear vel&amp;gt; &amp;lt;turnrate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command topics to Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
These topics start as:&lt;br /&gt;
&lt;br /&gt;
* dtubot/cmd/ti/&lt;br /&gt;
&lt;br /&gt;
Examples from the MQTT-in logger (log_mqtt_in.txt):&lt;br /&gt;
&lt;br /&gt;
 1738498850.8640 0 drive dtubot/cmd/ti log 1&lt;br /&gt;
 1738498851.3836 0 drive dtubot/cmd/ti rc 0.0 0.0&lt;br /&gt;
 1738498851.3969 0 drive dtubot/cmd/ti rc 0.250 -1.000 1738498851.3969011&lt;br /&gt;
 1738498851.8492 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498851.8627 0 drive dtubot/cmd/ti rc 0.250 0.119 1738498851.8626823&lt;br /&gt;
 1738498852.2016 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498857.8342 0 drive dtubot/cmd/ti log 0&lt;br /&gt;
The &#039;&#039;teensy_interface&#039;&#039; logger adds the first 3 columns; the rest are the MQTT topic and message.&lt;br /&gt;
&lt;br /&gt;
=== Master topic ===&lt;br /&gt;
&lt;br /&gt;
Only one MQTT client should be allowed to act as the master; at this point, this is the client&#039;s responsibility.&lt;br /&gt;
&lt;br /&gt;
A master regularly publishes a live message that includes a timestamp as payload, e.g. every 400ms:&lt;br /&gt;
&lt;br /&gt;
 at 1739609901.9768: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.3793: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.7721: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
If this is the first (or the only) MQTT client that wants to control the robot, then the &#039;&#039;teensy_interface&#039;&#039; publishes a master message with this timestamp, like:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/master 1739609909.5709 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
The first parameter is a timestamp, as usual. The last part, &#039;&#039;2025-02-15 09:57:53.433439&#039;&#039;, is a copy of the alive message from a master.&lt;br /&gt;
&lt;br /&gt;
The master should then test whether the master message matches its timestamp. If not, the MQTT client should terminate.&lt;br /&gt;
&lt;br /&gt;
If there is a match, the MQTT client prints the message % I am now accepted as master of robot XXX.&amp;quot; It can happen that it hasn&#039;t received the robot&#039;s name yet, then it would say &amp;quot;unknown&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the teensy_interface has not received an alive message from the accepted master for some time (2 seconds), it will stop the robot and allow a new master.&lt;br /&gt;
&lt;br /&gt;
== Commands topics to the Teensy ==&lt;br /&gt;
&lt;br /&gt;
Messages to the Teensy use the topic:&lt;br /&gt;
 dtubot/cmd/T0&lt;br /&gt;
The message will start with a command keyword.&lt;br /&gt;
As an example, a command to subscribe to gyro data could be:&lt;br /&gt;
 topic:   dtubot/cmd/T0&lt;br /&gt;
 message: sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy interface sends the message part to the Teensy, in this case:&lt;br /&gt;
 sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy reply is a gyro message every 15 ms:&lt;br /&gt;
 gyro x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 gyro -0.021606 0.115082 0.381836&lt;br /&gt;
where the three values are the rotation speed in degrees per second.&lt;br /&gt;
The values are averaged over the subscription interval to reduce noise.&lt;br /&gt;
&lt;br /&gt;
These messages are translated to MQTT as&lt;br /&gt;
 topic: dtubot/drive/T0/gyro&lt;br /&gt;
 message: time x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 message: 1740818119.4175 -0.021606 0.115082 0.381836&lt;br /&gt;
The message now prepends the Raspberry Pi timestamp, in seconds since the start of the epoch.&lt;br /&gt;
&lt;br /&gt;
The available commands are listed on the [[Help page Teensy 8]].&lt;br /&gt;
&lt;br /&gt;
== Subscription test (gyro) ==&lt;br /&gt;
&lt;br /&gt;
Install mosquitto; see: https://mosquitto.org/download/&lt;br /&gt;
&lt;br /&gt;
This has command line functions &#039;&#039;mosquitto_pub&#039;&#039; and &#039;&#039;mosquitto_sub&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any other MQTT app would probably do as well.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe ===&lt;br /&gt;
&lt;br /&gt;
To see the messages from the teensy_interface, assuming the robot has the IP 10.197.218.72, you could try:&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/#&lt;br /&gt;
Or just the gyro messages&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/gyro&lt;br /&gt;
&lt;br /&gt;
It should then reply with something like (for all messages):&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2093 -0.028076 0.027344 1.025879 31618.027&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2094 31618.0273 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2126 -0.113159 -0.068024 0.168213 31618.031&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2127 -0.026611 0.023926 1.023193 31618.031&lt;br /&gt;
 dtubot/drive/T0/vel 1739638296.2128 31618.0312 0.000 0.000 0.0000 0.000 4&lt;br /&gt;
 dtubot/drive/T0/mvel 1739638296.2131 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2139 31618.0332 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2150 -0.052124 -0.006989 0.351318 31618.033&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2151 -0.028809 0.029053 1.022461 31618.033&lt;br /&gt;
 dtubot/drive/T0/current 1739638296.2162 -0.000 0.000&lt;br /&gt;
&lt;br /&gt;
=== Send command ===&lt;br /&gt;
&lt;br /&gt;
To get gyro data faster, as an example:&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 1&amp;quot;&lt;br /&gt;
Or stopping gyro streaming&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8791</id>
		<title>Robobot MQTT topics</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8791"/>
		<updated>2026-05-15T11:07:37Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Command topics to Teensy_interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot_B| Robobot]]&lt;br /&gt;
&lt;br /&gt;
== MQTT ==&lt;br /&gt;
&lt;br /&gt;
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol for transporting messages between processes and across networks.&lt;br /&gt;
&lt;br /&gt;
The used MQTT server is Mosquitto from https://mosquitto.org/&lt;br /&gt;
&lt;br /&gt;
The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html&lt;br /&gt;
&lt;br /&gt;
Mosquitto comes with commands for &#039;&#039;publish&#039;&#039; and subscribe directly from the command line, e.g.:&lt;br /&gt;
&lt;br /&gt;
 mosquitto_pub -h 10.197.218.81 -t dtubot/cmd/T0 -m &amp;quot;sub ir 300&amp;quot;&lt;br /&gt;
 mosquitto_sub -h 10.197.218.81 -v -t dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The used options are: &#039;&#039;-h&#039;&#039; for host, &#039;&#039;-t&#039;&#039; for topic and &#039;&#039;-m&#039;&#039; for message.&lt;br /&gt;
&lt;br /&gt;
Many other MQTT apps can be used too.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MQTT-explorer&#039;&#039; is recommended and available on all platforms. see: http://mqtt-explorer.com/&lt;br /&gt;
&lt;br /&gt;
[[file: mqtt-server-with-app.png | 770px]]&lt;br /&gt;
&lt;br /&gt;
MQTT message flow and power off. MQTT Explorer can explore messages. The &#039;&#039;ip_display&#039;&#039; does not display the IP address; it is handled by the &#039;&#039;teensy_interface&#039;&#039; (legacy names). The &#039;&#039;Start&#039;&#039; button starts the Python mission app. All receive the shutdown (&amp;gt;5 sec on &#039;Start&#039;). The Teensy is told to cut power in 20 seconds to allow the Raspberry to shut down.&lt;br /&gt;
&lt;br /&gt;
== Robobot ==&lt;br /&gt;
&lt;br /&gt;
Robobot uses MQTT &lt;br /&gt;
&lt;br /&gt;
[[file:robobot-mqtt-2025.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The MQTT server connects the Teensy_interface with the behaviour part of the robot.&lt;br /&gt;
&lt;br /&gt;
=== Data topics (from firmware) ===&lt;br /&gt;
&lt;br /&gt;
Data messages mainly originate from the Teensy firmware, where they can be subscribed to.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/#&lt;br /&gt;
&lt;br /&gt;
All used topics start with the keyword &amp;lt;code&amp;gt;dtubot/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; is a wildcard that matches all sub-topics.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The sub-topic &amp;lt;code&amp;gt;dtubot/drive/&amp;lt;/code&amp;gt; is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy &amp;lt;code&amp;gt;T0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Data messages ====&lt;br /&gt;
&lt;br /&gt;
Data types described in [[Help page Teensy_8]] generate messages starting with a keyword and some parameters. &lt;br /&gt;
The keyword is used as a subtopic, e.g.:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose    is a pose message&lt;br /&gt;
&lt;br /&gt;
The parameters are then the MQTT message &amp;quot;payload&amp;quot;,&lt;br /&gt;
examples of a pose message are:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241&lt;br /&gt;
&lt;br /&gt;
After the topic &#039;&#039;dtubot/drive/T0/pose&#039;&#039; is the payload.&lt;br /&gt;
&lt;br /&gt;
The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).&lt;br /&gt;
&lt;br /&gt;
In this case, the remaining data are Teensy time (sec), x- and y-positions, heading (radians), and tilt (radians).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.7999 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587&lt;br /&gt;
 dtubot/drive/T0/current 1738930269.8004 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/dist    1738930269.8027 0.623 0.469&lt;br /&gt;
 dtubot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.8073 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241&lt;br /&gt;
 dtubot/drive/T0/conf    1738499287.6484 0.0750 0.0750 19.000 68 0.2300 0.0020 0&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597&lt;br /&gt;
 dtubot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23&lt;br /&gt;
&lt;br /&gt;
Most parameters are numeric but may contain text, as in the last message.&lt;br /&gt;
&lt;br /&gt;
At times, the Teensy sends a comment or a debug message. Such messages are sent with the &#039;&#039;info&#039;&#039; topic. A &#039;&#039;#&#039;&#039; always precedes the data in the payload.&lt;br /&gt;
&lt;br /&gt;
== Command topics from Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
The teensy interface can publish messages related to its own state, such as:&lt;br /&gt;
 dtubot/drive/gnss        &amp;quot;&amp;lt;time&amp;gt; &amp;lt;lat&amp;gt; &amp;lt;long&amp;gt; &amp;lt;speed&amp;gt; &amp;lt;sats&amp;gt; &amp;lt;dop&amp;gt;&amp;quot;&lt;br /&gt;
 dtubot/drive/joy/axis    &amp;quot;&amp;lt;time&amp;gt; &amp;lt;axis1&amp;gt; &amp;lt;axis2&amp;gt; ... &amp;lt;axis8&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/buttons &amp;quot;&amp;lt;time&amp;gt; &amp;lt;but1&amp;gt; &amp;lt;but2&amp;gt; ... &amp;lt;but11&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/state   &amp;quot;&amp;lt;time&amp;gt; &amp;lt;manual&amp;gt; &amp;lt;linear vel&amp;gt; &amp;lt;turnrate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command topics to Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
These topics start as:&lt;br /&gt;
&lt;br /&gt;
* dtubot/cmd/ti/&lt;br /&gt;
&lt;br /&gt;
Examples from the MQTT-in logger (log_mqtt_in.txt):&lt;br /&gt;
&lt;br /&gt;
 1738498850.8640 0 drive dtubot/cmd/ti log 1&lt;br /&gt;
 1738498851.3836 0 drive dtubot/cmd/ti rc 0.0 0.0&lt;br /&gt;
 1738498851.3969 0 drive dtubot/cmd/ti rc 0.250 -1.000 1738498851.3969011&lt;br /&gt;
 1738498851.8492 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498851.8627 0 drive dtubot/cmd/ti rc 0.250 0.119 1738498851.8626823&lt;br /&gt;
 1738498852.2016 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498857.8342 0 drive dtubot/cmd/ti log 0&lt;br /&gt;
The &#039;&#039;teensy_interface&#039;&#039; logger adds the first 3 columns; the rest are the MQTT topic and message.&lt;br /&gt;
&lt;br /&gt;
=== Master topic ===&lt;br /&gt;
&lt;br /&gt;
Only one MQTT client should be allowed to act as the master; at this point, this is the client&#039;s responsibility.&lt;br /&gt;
&lt;br /&gt;
A master regularly publishes a live message that includes a timestamp as payload, e.g. every 400ms:&lt;br /&gt;
&lt;br /&gt;
 at 1739609901.9768: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.3793: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.7721: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
If this is the first (or the only) MQTT client that wants to control the robot, then the &#039;&#039;teensy_interface&#039;&#039; publishes a master message with this timestamp, like:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/master 1739609909.5709 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
The first parameter is a timestamp, as usual. The last part, &#039;&#039;2025-02-15 09:57:53.433439&#039;&#039;, is a copy of the alive message from a master.&lt;br /&gt;
&lt;br /&gt;
The master should then test whether the master message matches its timestamp. If not, the MQTT client should terminate.&lt;br /&gt;
&lt;br /&gt;
If there is a match, the MQTT client prints the message % I am now accepted as master of robot XXX.&amp;quot; It can happen that it hasn&#039;t received the robot&#039;s name yet, then it would say &amp;quot;unknown&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the teensy_interface has not received an alive message from the accepted master for some time (2 seconds), it will stop the robot and allow a new master.&lt;br /&gt;
&lt;br /&gt;
== Commands topics to the Teensy ==&lt;br /&gt;
&lt;br /&gt;
Messages to the Teensy use the topic:&lt;br /&gt;
 dtubot/cmd/T0&lt;br /&gt;
The message will start with a command keyword.&lt;br /&gt;
As an example, a command to subscribe to gyro data could be:&lt;br /&gt;
 topic:   dtubot/cmd/T0&lt;br /&gt;
 message: sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy interface sends the message part to the Teensy, in this case:&lt;br /&gt;
 sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy reply is a gyro message every 15 ms:&lt;br /&gt;
 gyro x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 gyro -0.021606 0.115082 0.381836&lt;br /&gt;
where the three values are the rotation speed in degrees per second.&lt;br /&gt;
The values are averaged over the subscription interval to reduce noise.&lt;br /&gt;
&lt;br /&gt;
These messages are translated to MQTT as&lt;br /&gt;
 topic: dtubot/drive/T0/gyro&lt;br /&gt;
 message: time x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 message: 1740818119.4175 -0.021606 0.115082 0.381836&lt;br /&gt;
The message now prepends the Raspberry Pi timestamp, in seconds since the start of the epoch.&lt;br /&gt;
&lt;br /&gt;
The available commands are listed on the [[Help page Teensy 8]].&lt;br /&gt;
&lt;br /&gt;
== Subscription test (gyro) ==&lt;br /&gt;
&lt;br /&gt;
Install mosquitto; see: https://mosquitto.org/download/&lt;br /&gt;
&lt;br /&gt;
This has command line functions &#039;&#039;mosquitto_pub&#039;&#039; and &#039;&#039;mosquitto_sub&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any other MQTT app would probably do as well.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe ===&lt;br /&gt;
&lt;br /&gt;
To see the messages from the teensy_interface, assuming the robot has the IP 10.197.218.72, you could try:&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/#&lt;br /&gt;
Or just the gyro messages&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/gyro&lt;br /&gt;
&lt;br /&gt;
It should then reply with something like (for all messages):&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2093 -0.028076 0.027344 1.025879 31618.027&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2094 31618.0273 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2126 -0.113159 -0.068024 0.168213 31618.031&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2127 -0.026611 0.023926 1.023193 31618.031&lt;br /&gt;
 dtubot/drive/T0/vel 1739638296.2128 31618.0312 0.000 0.000 0.0000 0.000 4&lt;br /&gt;
 dtubot/drive/T0/mvel 1739638296.2131 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2139 31618.0332 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2150 -0.052124 -0.006989 0.351318 31618.033&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2151 -0.028809 0.029053 1.022461 31618.033&lt;br /&gt;
 dtubot/drive/T0/current 1739638296.2162 -0.000 0.000&lt;br /&gt;
&lt;br /&gt;
=== Send command ===&lt;br /&gt;
&lt;br /&gt;
To get gyro data faster, as an example:&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 1&amp;quot;&lt;br /&gt;
Or stopping gyro streaming&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8790</id>
		<title>Robobot MQTT topics</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8790"/>
		<updated>2026-05-15T11:00:43Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Command topics to Teensy_interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot_B| Robobot]]&lt;br /&gt;
&lt;br /&gt;
== MQTT ==&lt;br /&gt;
&lt;br /&gt;
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol for transporting messages between processes and across networks.&lt;br /&gt;
&lt;br /&gt;
The used MQTT server is Mosquitto from https://mosquitto.org/&lt;br /&gt;
&lt;br /&gt;
The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html&lt;br /&gt;
&lt;br /&gt;
Mosquitto comes with commands for &#039;&#039;publish&#039;&#039; and subscribe directly from the command line, e.g.:&lt;br /&gt;
&lt;br /&gt;
 mosquitto_pub -h 10.197.218.81 -t dtubot/cmd/T0 -m &amp;quot;sub ir 300&amp;quot;&lt;br /&gt;
 mosquitto_sub -h 10.197.218.81 -v -t dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The used options are: &#039;&#039;-h&#039;&#039; for host, &#039;&#039;-t&#039;&#039; for topic and &#039;&#039;-m&#039;&#039; for message.&lt;br /&gt;
&lt;br /&gt;
Many other MQTT apps can be used too.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MQTT-explorer&#039;&#039; is recommended and available on all platforms. see: http://mqtt-explorer.com/&lt;br /&gt;
&lt;br /&gt;
[[file: mqtt-server-with-app.png | 770px]]&lt;br /&gt;
&lt;br /&gt;
MQTT message flow and power off. MQTT Explorer can explore messages. The &#039;&#039;ip_display&#039;&#039; does not display the IP address; it is handled by the &#039;&#039;teensy_interface&#039;&#039; (legacy names). The &#039;&#039;Start&#039;&#039; button starts the Python mission app. All receive the shutdown (&amp;gt;5 sec on &#039;Start&#039;). The Teensy is told to cut power in 20 seconds to allow the Raspberry to shut down.&lt;br /&gt;
&lt;br /&gt;
== Robobot ==&lt;br /&gt;
&lt;br /&gt;
Robobot uses MQTT &lt;br /&gt;
&lt;br /&gt;
[[file:robobot-mqtt-2025.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The MQTT server connects the Teensy_interface with the behaviour part of the robot.&lt;br /&gt;
&lt;br /&gt;
=== Data topics (from firmware) ===&lt;br /&gt;
&lt;br /&gt;
Data messages mainly originate from the Teensy firmware, where they can be subscribed to.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/#&lt;br /&gt;
&lt;br /&gt;
All used topics start with the keyword &amp;lt;code&amp;gt;dtubot/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; is a wildcard that matches all sub-topics.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The sub-topic &amp;lt;code&amp;gt;dtubot/drive/&amp;lt;/code&amp;gt; is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy &amp;lt;code&amp;gt;T0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Data messages ====&lt;br /&gt;
&lt;br /&gt;
Data types described in [[Help page Teensy_8]] generate messages starting with a keyword and some parameters. &lt;br /&gt;
The keyword is used as a subtopic, e.g.:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose    is a pose message&lt;br /&gt;
&lt;br /&gt;
The parameters are then the MQTT message &amp;quot;payload&amp;quot;,&lt;br /&gt;
examples of a pose message are:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241&lt;br /&gt;
&lt;br /&gt;
After the topic &#039;&#039;dtubot/drive/T0/pose&#039;&#039; is the payload.&lt;br /&gt;
&lt;br /&gt;
The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).&lt;br /&gt;
&lt;br /&gt;
In this case, the remaining data are Teensy time (sec), x- and y-positions, heading (radians), and tilt (radians).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.7999 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587&lt;br /&gt;
 dtubot/drive/T0/current 1738930269.8004 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/dist    1738930269.8027 0.623 0.469&lt;br /&gt;
 dtubot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.8073 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241&lt;br /&gt;
 dtubot/drive/T0/conf    1738499287.6484 0.0750 0.0750 19.000 68 0.2300 0.0020 0&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597&lt;br /&gt;
 dtubot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23&lt;br /&gt;
&lt;br /&gt;
Most parameters are numeric but may contain text, as in the last message.&lt;br /&gt;
&lt;br /&gt;
At times, the Teensy sends a comment or a debug message. Such messages are sent with the &#039;&#039;info&#039;&#039; topic. A &#039;&#039;#&#039;&#039; always precedes the data in the payload.&lt;br /&gt;
&lt;br /&gt;
== Command topics from Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
The teensy interface can publish messages related to its own state, such as:&lt;br /&gt;
 dtubot/drive/gnss        &amp;quot;&amp;lt;time&amp;gt; &amp;lt;lat&amp;gt; &amp;lt;long&amp;gt; &amp;lt;speed&amp;gt; &amp;lt;sats&amp;gt; &amp;lt;dop&amp;gt;&amp;quot;&lt;br /&gt;
 dtubot/drive/joy/axis    &amp;quot;&amp;lt;time&amp;gt; &amp;lt;axis1&amp;gt; &amp;lt;axis2&amp;gt; ... &amp;lt;axis8&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/buttons &amp;quot;&amp;lt;time&amp;gt; &amp;lt;but1&amp;gt; &amp;lt;but2&amp;gt; ... &amp;lt;but11&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/state   &amp;quot;&amp;lt;time&amp;gt; &amp;lt;manual&amp;gt; &amp;lt;linear vel&amp;gt; &amp;lt;turnrate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command topics to Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
These topics start as:&lt;br /&gt;
&lt;br /&gt;
* dtubot/cmd/ti/&lt;br /&gt;
&lt;br /&gt;
Examples are (from the MQTT-in logger):&lt;br /&gt;
&lt;br /&gt;
 1738498850.8640 0 drive dtubot/cmd/ti log 1&lt;br /&gt;
 1738498851.3836 0 drive dtubot/cmd/ti rc 0.0 0.0&lt;br /&gt;
 1738498851.3969 0 drive dtubot/cmd/ti rc 0.250 -1.000 1738498851.3969011&lt;br /&gt;
 1738498851.8492 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498851.8627 0 drive dtubot/cmd/ti rc 0.250 0.119 1738498851.8626823&lt;br /&gt;
 1738498852.2016 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498857.8342 0 drive dtubot/cmd/ti log 0&lt;br /&gt;
The &#039;&#039;teensy_interface&#039;&#039; logger adds the first 3 columns; the rest are topic and message.&lt;br /&gt;
&lt;br /&gt;
=== Master topic ===&lt;br /&gt;
&lt;br /&gt;
A master regularly publishes a live message that includes a timestamp as payload, e.g. every 400ms:&lt;br /&gt;
&lt;br /&gt;
 at 1739609901.9768: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.3793: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.7721: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
If this is the first (or the only) MQTT client that wants to control the robot, then the &#039;&#039;teensy_interface&#039;&#039; publishes a master message with this timestamp, like:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/master 1739609909.5709 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
The first parameter is a timestamp, as usual. The last part, &#039;&#039;2025-02-15 09:57:53.433439&#039;&#039;, is a copy of the alive message from a master.&lt;br /&gt;
&lt;br /&gt;
The master should then test whether the master message matches its timestamp. If not, the MQTT client should terminate.&lt;br /&gt;
&lt;br /&gt;
If there is a match, the MQTT client prints the message % I am now accepted as master of robot XXX.&amp;quot; It can happen that it hasn&#039;t received the robot&#039;s name yet, then it would say &amp;quot;unknown&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the teensy_interface has not received an alive message from the accepted master for some time (2 seconds), it will stop the robot and allow a new master.&lt;br /&gt;
&lt;br /&gt;
== Commands topics to the Teensy ==&lt;br /&gt;
&lt;br /&gt;
Messages to the Teensy use the topic:&lt;br /&gt;
 dtubot/cmd/T0&lt;br /&gt;
The message will start with a command keyword.&lt;br /&gt;
As an example, a command to subscribe to gyro data could be:&lt;br /&gt;
 topic:   dtubot/cmd/T0&lt;br /&gt;
 message: sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy interface sends the message part to the Teensy, in this case:&lt;br /&gt;
 sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy reply is a gyro message every 15 ms:&lt;br /&gt;
 gyro x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 gyro -0.021606 0.115082 0.381836&lt;br /&gt;
where the three values are the rotation speed in degrees per second.&lt;br /&gt;
The values are averaged over the subscription interval to reduce noise.&lt;br /&gt;
&lt;br /&gt;
These messages are translated to MQTT as&lt;br /&gt;
 topic: dtubot/drive/T0/gyro&lt;br /&gt;
 message: time x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 message: 1740818119.4175 -0.021606 0.115082 0.381836&lt;br /&gt;
The message now prepends the Raspberry Pi timestamp, in seconds since the start of the epoch.&lt;br /&gt;
&lt;br /&gt;
The available commands are listed on the [[Help page Teensy 8]].&lt;br /&gt;
&lt;br /&gt;
== Subscription test (gyro) ==&lt;br /&gt;
&lt;br /&gt;
Install mosquitto; see: https://mosquitto.org/download/&lt;br /&gt;
&lt;br /&gt;
This has command line functions &#039;&#039;mosquitto_pub&#039;&#039; and &#039;&#039;mosquitto_sub&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any other MQTT app would probably do as well.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe ===&lt;br /&gt;
&lt;br /&gt;
To see the messages from the teensy_interface, assuming the robot has the IP 10.197.218.72, you could try:&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/#&lt;br /&gt;
Or just the gyro messages&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/gyro&lt;br /&gt;
&lt;br /&gt;
It should then reply with something like (for all messages):&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2093 -0.028076 0.027344 1.025879 31618.027&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2094 31618.0273 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2126 -0.113159 -0.068024 0.168213 31618.031&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2127 -0.026611 0.023926 1.023193 31618.031&lt;br /&gt;
 dtubot/drive/T0/vel 1739638296.2128 31618.0312 0.000 0.000 0.0000 0.000 4&lt;br /&gt;
 dtubot/drive/T0/mvel 1739638296.2131 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2139 31618.0332 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2150 -0.052124 -0.006989 0.351318 31618.033&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2151 -0.028809 0.029053 1.022461 31618.033&lt;br /&gt;
 dtubot/drive/T0/current 1739638296.2162 -0.000 0.000&lt;br /&gt;
&lt;br /&gt;
=== Send command ===&lt;br /&gt;
&lt;br /&gt;
To get gyro data faster, as an example:&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 1&amp;quot;&lt;br /&gt;
Or stopping gyro streaming&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8789</id>
		<title>Robobot MQTT topics</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8789"/>
		<updated>2026-05-15T10:58:04Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot_B| Robobot]]&lt;br /&gt;
&lt;br /&gt;
== MQTT ==&lt;br /&gt;
&lt;br /&gt;
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol for transporting messages between processes and across networks.&lt;br /&gt;
&lt;br /&gt;
The used MQTT server is Mosquitto from https://mosquitto.org/&lt;br /&gt;
&lt;br /&gt;
The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html&lt;br /&gt;
&lt;br /&gt;
Mosquitto comes with commands for &#039;&#039;publish&#039;&#039; and subscribe directly from the command line, e.g.:&lt;br /&gt;
&lt;br /&gt;
 mosquitto_pub -h 10.197.218.81 -t dtubot/cmd/T0 -m &amp;quot;sub ir 300&amp;quot;&lt;br /&gt;
 mosquitto_sub -h 10.197.218.81 -v -t dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The used options are: &#039;&#039;-h&#039;&#039; for host, &#039;&#039;-t&#039;&#039; for topic and &#039;&#039;-m&#039;&#039; for message.&lt;br /&gt;
&lt;br /&gt;
Many other MQTT apps can be used too.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MQTT-explorer&#039;&#039; is recommended and available on all platforms. see: http://mqtt-explorer.com/&lt;br /&gt;
&lt;br /&gt;
[[file: mqtt-server-with-app.png | 770px]]&lt;br /&gt;
&lt;br /&gt;
MQTT message flow and power off. MQTT Explorer can explore messages. The &#039;&#039;ip_display&#039;&#039; does not display the IP address; it is handled by the &#039;&#039;teensy_interface&#039;&#039; (legacy names). The &#039;&#039;Start&#039;&#039; button starts the Python mission app. All receive the shutdown (&amp;gt;5 sec on &#039;Start&#039;). The Teensy is told to cut power in 20 seconds to allow the Raspberry to shut down.&lt;br /&gt;
&lt;br /&gt;
== Robobot ==&lt;br /&gt;
&lt;br /&gt;
Robobot uses MQTT &lt;br /&gt;
&lt;br /&gt;
[[file:robobot-mqtt-2025.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The MQTT server connects the Teensy_interface with the behaviour part of the robot.&lt;br /&gt;
&lt;br /&gt;
=== Data topics (from firmware) ===&lt;br /&gt;
&lt;br /&gt;
Data messages mainly originate from the Teensy firmware, where they can be subscribed to.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/#&lt;br /&gt;
&lt;br /&gt;
All used topics start with the keyword &amp;lt;code&amp;gt;dtubot/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; is a wildcard that matches all sub-topics.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The sub-topic &amp;lt;code&amp;gt;dtubot/drive/&amp;lt;/code&amp;gt; is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy &amp;lt;code&amp;gt;T0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Data messages ====&lt;br /&gt;
&lt;br /&gt;
Data types described in [[Help page Teensy_8]] generate messages starting with a keyword and some parameters. &lt;br /&gt;
The keyword is used as a subtopic, e.g.:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose    is a pose message&lt;br /&gt;
&lt;br /&gt;
The parameters are then the MQTT message &amp;quot;payload&amp;quot;,&lt;br /&gt;
examples of a pose message are:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241&lt;br /&gt;
&lt;br /&gt;
After the topic &#039;&#039;dtubot/drive/T0/pose&#039;&#039; is the payload.&lt;br /&gt;
&lt;br /&gt;
The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).&lt;br /&gt;
&lt;br /&gt;
In this case, the remaining data are Teensy time (sec), x- and y-positions, heading (radians), and tilt (radians).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.7999 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587&lt;br /&gt;
 dtubot/drive/T0/current 1738930269.8004 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/dist    1738930269.8027 0.623 0.469&lt;br /&gt;
 dtubot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.8073 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241&lt;br /&gt;
 dtubot/drive/T0/conf    1738499287.6484 0.0750 0.0750 19.000 68 0.2300 0.0020 0&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597&lt;br /&gt;
 dtubot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23&lt;br /&gt;
&lt;br /&gt;
Most parameters are numeric but may contain text, as in the last message.&lt;br /&gt;
&lt;br /&gt;
At times, the Teensy sends a comment or a debug message. Such messages are sent with the &#039;&#039;info&#039;&#039; topic. A &#039;&#039;#&#039;&#039; always precedes the data in the payload.&lt;br /&gt;
&lt;br /&gt;
== Command topics from Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
The teensy interface can publish messages related to its own state, such as:&lt;br /&gt;
 dtubot/drive/gnss        &amp;quot;&amp;lt;time&amp;gt; &amp;lt;lat&amp;gt; &amp;lt;long&amp;gt; &amp;lt;speed&amp;gt; &amp;lt;sats&amp;gt; &amp;lt;dop&amp;gt;&amp;quot;&lt;br /&gt;
 dtubot/drive/joy/axis    &amp;quot;&amp;lt;time&amp;gt; &amp;lt;axis1&amp;gt; &amp;lt;axis2&amp;gt; ... &amp;lt;axis8&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/buttons &amp;quot;&amp;lt;time&amp;gt; &amp;lt;but1&amp;gt; &amp;lt;but2&amp;gt; ... &amp;lt;but11&amp;gt;&lt;br /&gt;
 dtubot/drive/joy/state   &amp;quot;&amp;lt;time&amp;gt; &amp;lt;manual&amp;gt; &amp;lt;linear vel&amp;gt; &amp;lt;turnrate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command topics to Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
These topics start as:&lt;br /&gt;
&lt;br /&gt;
* dtubot/cmd/ti/&lt;br /&gt;
&lt;br /&gt;
Examples are:&lt;br /&gt;
&lt;br /&gt;
 1738498850.8640 0 drive dtubot/cmd/ti log 1&lt;br /&gt;
 1738498851.3836 0 drive dtubot/cmd/ti rc 0.0 0.0&lt;br /&gt;
 1738498851.3969 0 drive dtubot/cmd/ti rc 0.250 -1.000 1738498851.3969011&lt;br /&gt;
 1738498851.8492 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498851.8627 0 drive dtubot/cmd/ti rc 0.250 0.119 1738498851.8626823&lt;br /&gt;
 1738498852.2016 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498857.8342 0 drive dtubot/cmd/ti log 0&lt;br /&gt;
The &#039;&#039;teensy_interface&#039;&#039; logger adds the first 3 columns; the rest are topic and message.&lt;br /&gt;
&lt;br /&gt;
=== Master topic ===&lt;br /&gt;
&lt;br /&gt;
A master regularly publishes a live message that includes a timestamp as payload, e.g. every 400ms:&lt;br /&gt;
&lt;br /&gt;
 at 1739609901.9768: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.3793: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.7721: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
If this is the first (or the only) MQTT client that wants to control the robot, then the &#039;&#039;teensy_interface&#039;&#039; publishes a master message with this timestamp, like:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/master 1739609909.5709 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
The first parameter is a timestamp, as usual. The last part, &#039;&#039;2025-02-15 09:57:53.433439&#039;&#039;, is a copy of the alive message from a master.&lt;br /&gt;
&lt;br /&gt;
The master should then test whether the master message matches its timestamp. If not, the MQTT client should terminate.&lt;br /&gt;
&lt;br /&gt;
If there is a match, the MQTT client prints the message % I am now accepted as master of robot XXX.&amp;quot; It can happen that it hasn&#039;t received the robot&#039;s name yet, then it would say &amp;quot;unknown&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the teensy_interface has not received an alive message from the accepted master for some time (2 seconds), it will stop the robot and allow a new master.&lt;br /&gt;
&lt;br /&gt;
== Commands topics to the Teensy ==&lt;br /&gt;
&lt;br /&gt;
Messages to the Teensy use the topic:&lt;br /&gt;
 dtubot/cmd/T0&lt;br /&gt;
The message will start with a command keyword.&lt;br /&gt;
As an example, a command to subscribe to gyro data could be:&lt;br /&gt;
 topic:   dtubot/cmd/T0&lt;br /&gt;
 message: sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy interface sends the message part to the Teensy, in this case:&lt;br /&gt;
 sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy reply is a gyro message every 15 ms:&lt;br /&gt;
 gyro x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 gyro -0.021606 0.115082 0.381836&lt;br /&gt;
where the three values are the rotation speed in degrees per second.&lt;br /&gt;
The values are averaged over the subscription interval to reduce noise.&lt;br /&gt;
&lt;br /&gt;
These messages are translated to MQTT as&lt;br /&gt;
 topic: dtubot/drive/T0/gyro&lt;br /&gt;
 message: time x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 message: 1740818119.4175 -0.021606 0.115082 0.381836&lt;br /&gt;
The message now prepends the Raspberry Pi timestamp, in seconds since the start of the epoch.&lt;br /&gt;
&lt;br /&gt;
The available commands are listed on the [[Help page Teensy 8]].&lt;br /&gt;
&lt;br /&gt;
== Subscription test (gyro) ==&lt;br /&gt;
&lt;br /&gt;
Install mosquitto; see: https://mosquitto.org/download/&lt;br /&gt;
&lt;br /&gt;
This has command line functions &#039;&#039;mosquitto_pub&#039;&#039; and &#039;&#039;mosquitto_sub&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any other MQTT app would probably do as well.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe ===&lt;br /&gt;
&lt;br /&gt;
To see the messages from the teensy_interface, assuming the robot has the IP 10.197.218.72, you could try:&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/#&lt;br /&gt;
Or just the gyro messages&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/gyro&lt;br /&gt;
&lt;br /&gt;
It should then reply with something like (for all messages):&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2093 -0.028076 0.027344 1.025879 31618.027&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2094 31618.0273 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2126 -0.113159 -0.068024 0.168213 31618.031&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2127 -0.026611 0.023926 1.023193 31618.031&lt;br /&gt;
 dtubot/drive/T0/vel 1739638296.2128 31618.0312 0.000 0.000 0.0000 0.000 4&lt;br /&gt;
 dtubot/drive/T0/mvel 1739638296.2131 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2139 31618.0332 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2150 -0.052124 -0.006989 0.351318 31618.033&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2151 -0.028809 0.029053 1.022461 31618.033&lt;br /&gt;
 dtubot/drive/T0/current 1739638296.2162 -0.000 0.000&lt;br /&gt;
&lt;br /&gt;
=== Send command ===&lt;br /&gt;
&lt;br /&gt;
To get gyro data faster, as an example:&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 1&amp;quot;&lt;br /&gt;
Or stopping gyro streaming&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8788</id>
		<title>Robobot MQTT topics</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_MQTT_topics&amp;diff=8788"/>
		<updated>2026-05-15T10:41:05Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot_B| Robobot]]&lt;br /&gt;
&lt;br /&gt;
== MQTT ==&lt;br /&gt;
&lt;br /&gt;
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol for transporting messages between processes and across networks.&lt;br /&gt;
&lt;br /&gt;
The used MQTT server is Mosquitto from https://mosquitto.org/&lt;br /&gt;
&lt;br /&gt;
The interface library used in both the Teensy_interface and the MQTT_client is paho-mqtt: https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html&lt;br /&gt;
&lt;br /&gt;
Mosquitto comes with commands for &#039;&#039;publish&#039;&#039; and subscribe directly from the command line, e.g.:&lt;br /&gt;
&lt;br /&gt;
 mosquitto_pub -h 10.197.218.81 -t dtubot/cmd/T0 -m &amp;quot;sub ir 300&amp;quot;&lt;br /&gt;
 mosquitto_sub -h 10.197.218.81 -v -t dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The used options are: &#039;&#039;-h&#039;&#039; for host, &#039;&#039;-t&#039;&#039; for topic and &#039;&#039;-m&#039;&#039; for message.&lt;br /&gt;
&lt;br /&gt;
Many other MQTT apps can be used too.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;MQTT-explorer&#039;&#039; is recommended and available on all platforms. see: http://mqtt-explorer.com/&lt;br /&gt;
&lt;br /&gt;
[[file: mqtt-server-with-app.png | 770px]]&lt;br /&gt;
&lt;br /&gt;
MQTT message flow and power off. MQTT Explorer can explore messages. The &#039;&#039;ip_display&#039;&#039; does not display the IP address; it is handled by the &#039;&#039;teensy_interface&#039;&#039; (legacy names). The &#039;&#039;Start&#039;&#039; button starts the Python mission app. All receive the shutdown (&amp;gt;5 sec on &#039;Start&#039;). The Teensy is told to cut power in 20 seconds to allow the Raspberry to shut down.&lt;br /&gt;
&lt;br /&gt;
== Robobot ==&lt;br /&gt;
&lt;br /&gt;
Robobot uses MQTT &lt;br /&gt;
&lt;br /&gt;
[[file:robobot-mqtt-2025.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The MQTT server connects the Teensy_interface with the behaviour part of the robot.&lt;br /&gt;
&lt;br /&gt;
=== Data topics (from firmware) ===&lt;br /&gt;
&lt;br /&gt;
Data messages mainly originate from the Teensy firmware, where they can be subscribed to.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/#&lt;br /&gt;
&lt;br /&gt;
All used topics start with the keyword &amp;lt;code&amp;gt;dtubot/&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; is a wildcard that matches all sub-topics.&lt;br /&gt;
&lt;br /&gt;
* topic: dtubot/drive/T0/#&lt;br /&gt;
&lt;br /&gt;
The sub-topic &amp;lt;code&amp;gt;dtubot/drive/&amp;lt;/code&amp;gt; is used for all data messages sourced by the teensy_interface (data from the drive function and generated by the first (and only) Teensy &amp;lt;code&amp;gt;T0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Data messages ====&lt;br /&gt;
&lt;br /&gt;
Data types described in [[Help page Teensy_8]] generate messages starting with a keyword and some parameters. &lt;br /&gt;
The keyword is used as a subtopic, e.g.:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose    is a pose message&lt;br /&gt;
&lt;br /&gt;
The parameters are then the MQTT message &amp;quot;payload&amp;quot;,&lt;br /&gt;
examples of a pose message are:&lt;br /&gt;
&lt;br /&gt;
* dtubot/drive/T0/pose 1738930269.8039 2232.5911 0.583 0.702 2.5420 3.1241&lt;br /&gt;
&lt;br /&gt;
After the topic &#039;&#039;dtubot/drive/T0/pose&#039;&#039; is the payload.&lt;br /&gt;
&lt;br /&gt;
The payload is always pure text (7-bit ASCII), and the first data is always a timestamp in seconds (since 1 Jan 1970).&lt;br /&gt;
&lt;br /&gt;
In this case, the remaining data are Teensy time (sec), x- and y-positions, heading (radians), and tilt (radians).&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.7980 -0.448853 0.816986 -4.012695 2232.585&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.7992 2232.5859 -0.003 -0.008 -0.0200 -0.003 3&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.7992 2232.5859 0.583 0.702 2.5420 3.1239&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.7999 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/acc2    1738930269.8004 0.018066 -0.026367 0.984863 2232.587&lt;br /&gt;
 dtubot/drive/T0/current 1738930269.8004 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/dist    1738930269.8027 0.623 0.469&lt;br /&gt;
 dtubot/drive/T0/livn    1738930269.8061 203 195 193 202 197 200 209 217 195&lt;br /&gt;
 dtubot/drive/T0/vel     1738930269.8062 2232.5930 -0.003 -0.008 -0.0200 -0.003 4&lt;br /&gt;
 dtubot/drive/T0/mvel    1738930269.8073 -0.003 -0.008&lt;br /&gt;
 dtubot/drive/T0/pose    1738930269.8096 2232.5959 0.583 0.702 2.5420 3.1241&lt;br /&gt;
 dtubot/drive/T0/conf    1738499287.6484 0.0750 0.0750 19.000 68 0.2300 0.0020 0&lt;br /&gt;
 dtubot/drive/T0/gyro2   1738930269.8107 -0.815063 -1.807526 -4.348389 2232.597&lt;br /&gt;
 dtubot/drive/T0/info    1738918215.7251 # got confw: r1=0.075, r2=0.075, G=19, PPR=68, WB=0.23&lt;br /&gt;
&lt;br /&gt;
Most parameters are numeric but may contain text, as in the last message.&lt;br /&gt;
&lt;br /&gt;
At times, the Teensy sends a comment or a debug message. Such messages are sent with the &#039;&#039;info&#039;&#039; topic. A &#039;&#039;#&#039;&#039; always precedes the data in the payload.&lt;br /&gt;
&lt;br /&gt;
== Command topics to Teensy_interface ==&lt;br /&gt;
&lt;br /&gt;
These topics start as:&lt;br /&gt;
&lt;br /&gt;
* dtubot/cmd/ti/&lt;br /&gt;
&lt;br /&gt;
Examples are:&lt;br /&gt;
&lt;br /&gt;
 1738498850.8640 0 drive dtubot/cmd/ti log 1&lt;br /&gt;
 1738498851.3836 0 drive dtubot/cmd/ti rc 0.0 0.0&lt;br /&gt;
 1738498851.3969 0 drive dtubot/cmd/ti rc 0.250 -1.000 1738498851.3969011&lt;br /&gt;
 1738498851.8492 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498851.8627 0 drive dtubot/cmd/ti rc 0.250 0.119 1738498851.8626823&lt;br /&gt;
 1738498852.2016 0 drive dtubot/cmd/ti alive 2025-02-02 13:20:50.861066&lt;br /&gt;
 1738498857.8342 0 drive dtubot/cmd/ti log 0&lt;br /&gt;
The &#039;&#039;teensy_interface&#039;&#039; logger adds the first 3 columns; the rest are topic and message.&lt;br /&gt;
&lt;br /&gt;
=== Master topic ===&lt;br /&gt;
&lt;br /&gt;
A master regularly publishes a live message that includes a timestamp as payload, e.g. every 400ms:&lt;br /&gt;
&lt;br /&gt;
 at 1739609901.9768: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.3793: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
 at 1739609902.7721: dtubot/cmd/ti alive 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
If this is the first (or the only) MQTT client that wants to control the robot, then the &#039;&#039;teensy_interface&#039;&#039; publishes a master message with this timestamp, like:&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/master 1739609909.5709 2025-02-15 09:57:53.433439&lt;br /&gt;
&lt;br /&gt;
The first parameter is a timestamp, as usual. The last part, &#039;&#039;2025-02-15 09:57:53.433439&#039;&#039;, is a copy of the alive message from a master.&lt;br /&gt;
&lt;br /&gt;
The master should then test whether the master message matches its timestamp. If not, the MQTT client should terminate.&lt;br /&gt;
&lt;br /&gt;
If there is a match, the MQTT client prints the message % I am now accepted as master of robot XXX.&amp;quot; It can happen that it hasn&#039;t received the robot&#039;s name yet, then it would say &amp;quot;unknown&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the teensy_interface has not received an alive message from the accepted master for some time (2 seconds), it will stop the robot and allow a new master.&lt;br /&gt;
&lt;br /&gt;
== Commands topics to the Teensy ==&lt;br /&gt;
&lt;br /&gt;
Messages to the Teensy use the topic:&lt;br /&gt;
 dtubot/cmd/T0&lt;br /&gt;
The message will start with a command keyword.&lt;br /&gt;
As an example, a command to subscribe to gyro data could be:&lt;br /&gt;
 topic:   dtubot/cmd/T0&lt;br /&gt;
 message: sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy interface sends the message part to the Teensy, in this case:&lt;br /&gt;
 sub gyro 15&lt;br /&gt;
&lt;br /&gt;
The Teensy reply is a gyro message every 15 ms:&lt;br /&gt;
 gyro x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 gyro -0.021606 0.115082 0.381836&lt;br /&gt;
where the three values are the rotation speed in degrees per second.&lt;br /&gt;
The values are averaged over the subscription interval to reduce noise.&lt;br /&gt;
&lt;br /&gt;
These messages are translated to MQTT as&lt;br /&gt;
 topic: dtubot/drive/T0/gyro&lt;br /&gt;
 message: time x.xxxxx y.yyyyyy z.zzzzz, e.g.:&lt;br /&gt;
 message: 1740818119.4175 -0.021606 0.115082 0.381836&lt;br /&gt;
The message now prepends the Raspberry Pi timestamp, in seconds since the start of the epoch.&lt;br /&gt;
&lt;br /&gt;
The available commands are listed on the [[Help page Teensy 8]].&lt;br /&gt;
&lt;br /&gt;
== Subscription test (gyro) ==&lt;br /&gt;
&lt;br /&gt;
Install mosquitto; see: https://mosquitto.org/download/&lt;br /&gt;
&lt;br /&gt;
This has command line functions &#039;&#039;mosquitto_pub&#039;&#039; and &#039;&#039;mosquitto_sub&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any other MQTT app would probably do as well.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe ===&lt;br /&gt;
&lt;br /&gt;
To see the messages from the teensy_interface, assuming the robot has the IP 10.197.218.72, you could try:&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/#&lt;br /&gt;
Or just the gyro messages&lt;br /&gt;
 mosquitto_sub -v -h 10.197.218.72 -t dtubot/drive/T0/gyro&lt;br /&gt;
&lt;br /&gt;
It should then reply with something like (for all messages):&lt;br /&gt;
&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2093 -0.028076 0.027344 1.025879 31618.027&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2094 31618.0273 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2126 -0.113159 -0.068024 0.168213 31618.031&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2127 -0.026611 0.023926 1.023193 31618.031&lt;br /&gt;
 dtubot/drive/T0/vel 1739638296.2128 31618.0312 0.000 0.000 0.0000 0.000 4&lt;br /&gt;
 dtubot/drive/T0/mvel 1739638296.2131 0.000 0.000&lt;br /&gt;
 dtubot/drive/T0/pose 1739638296.2139 31618.0332 0.000 0.000 0.0000 3.1169&lt;br /&gt;
 dtubot/drive/T0/gyro 1739638296.2150 -0.052124 -0.006989 0.351318 31618.033&lt;br /&gt;
 dtubot/drive/T0/acc 1739638296.2151 -0.028809 0.029053 1.022461 31618.033&lt;br /&gt;
 dtubot/drive/T0/current 1739638296.2162 -0.000 0.000&lt;br /&gt;
&lt;br /&gt;
=== Send command ===&lt;br /&gt;
&lt;br /&gt;
To get gyro data faster, as an example:&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 1&amp;quot;&lt;br /&gt;
Or stopping gyro streaming&lt;br /&gt;
 mosquitto_pub -h 10.197.218.72 -t dtubot/cmd/T0/sub -m &amp;quot;gyro 0&amp;quot;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8787</id>
		<title>Ricbot realsense</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8787"/>
		<updated>2026-05-15T07:43:18Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Intel RealSense ==&lt;br /&gt;
&lt;br /&gt;
Install &lt;br /&gt;
 sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
&lt;br /&gt;
There is a script to download and compile, e.g. on Raspberry Pi here:&lt;br /&gt;
https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md&lt;br /&gt;
&lt;br /&gt;
To install pyrealsense2 at the same time as librealsense, line 46 of the &#039;libuvc_installation.sh&#039; build script should be changed from this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release&lt;br /&gt;
to this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true&lt;br /&gt;
From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373&lt;br /&gt;
&lt;br /&gt;
=== Library and examples ===&lt;br /&gt;
&lt;br /&gt;
This is an alternative to the script above.&lt;br /&gt;
&lt;br /&gt;
 cd ~/git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j3&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Copy udev rules to udev&lt;br /&gt;
&lt;br /&gt;
 sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
All example commands start with rs-, e.g.:&lt;br /&gt;
 rs-capture&lt;br /&gt;
 rs-pointcloud&lt;br /&gt;
&lt;br /&gt;
=== Intel Librealsense ===&lt;br /&gt;
&lt;br /&gt;
Installing support for Intel librealsense.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
 sudo apt-get install freeglut3-dev&lt;br /&gt;
 sudo apt-get install xorg-dev&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
&lt;br /&gt;
I also needed to install libusb-1.0-0-dev&lt;br /&gt;
 sudo apt install libusb-1.0-0-dev&lt;br /&gt;
This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 nano CMakeLists.txt&lt;br /&gt;
add&lt;br /&gt;
 include_directories( /usr/include/libusb-1.0/ )&lt;br /&gt;
like here:&lt;br /&gt;
 cmake_minimum_required(VERSION 3.10)&lt;br /&gt;
 &lt;br /&gt;
 set( LRS_TARGET realsense2 )&lt;br /&gt;
 project( ${LRS_TARGET} LANGUAGES CXX C )&lt;br /&gt;
 &lt;br /&gt;
 # Allow librealsense2 and all of the nested project to include the main repo folder&lt;br /&gt;
 set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})&lt;br /&gt;
 include_directories(${REPO_ROOT})&lt;br /&gt;
 &#039;&#039;&#039;include_directories( /usr/include/libusb-1.0/ )&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 include(CMake/lrs_options.cmake)&lt;br /&gt;
 include(CMake/connectivity_check.cmake)&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
== D435 failed at reboot ==&lt;br /&gt;
&lt;br /&gt;
The RealSense D435 is connected to a powered USB3 hub.&lt;br /&gt;
The Raspberry is powered by a 5V supply through expansion pins.&lt;br /&gt;
It is a default 64-bit Raspberry Pi OS:&lt;br /&gt;
 $ cat /etc/os-release &lt;br /&gt;
 PRETTY_NAME=&amp;quot;Debian GNU/Linux 12 (bookworm)&amp;quot;&lt;br /&gt;
 NAME=&amp;quot;Debian GNU/Linux&amp;quot;&lt;br /&gt;
 VERSION_ID=&amp;quot;12&amp;quot;&lt;br /&gt;
 VERSION=&amp;quot;12 (bookworm)&amp;quot;&lt;br /&gt;
 VERSION_CODENAME=bookworm&lt;br /&gt;
 ID=debian&lt;br /&gt;
&lt;br /&gt;
=== The error ===&lt;br /&gt;
At times (after reboot), I can no longer enumerate RealSense devices, and I get:&lt;br /&gt;
 $ rs-enumerate-devices &lt;br /&gt;
 15/05 09:00:33,247 ERROR [140732254925120] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY&lt;br /&gt;
 15/05 09:00:33,249 ERROR [140732304337472] (uvc-sensor.cpp:428) acquire_power failed: failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_create_device( info_list:0x555598c13730, index:0 ) UNKNOWN] failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument &amp;quot;device&amp;quot;&lt;br /&gt;
 Could not create device - failed to set power state . Check SDK logs for details&lt;br /&gt;
 No device detected. Is it plugged in?&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&lt;br /&gt;
But &#039;&#039;lsusb&#039;&#039; finds the device&lt;br /&gt;
&lt;br /&gt;
 $ lsusb&lt;br /&gt;
 Bus 004 Device 004: ID 8086:0b07 Intel Corp. RealSense D435&lt;br /&gt;
 Bus 004 Device 005: ID 2676:ba05 Basler AG Vision Camera&lt;br /&gt;
 Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 002: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
It seems to be a boot conflict of some sort, but resetting the USB seems to work.&lt;br /&gt;
&lt;br /&gt;
From the usbutils package, run the command:&lt;br /&gt;
 $ usbreset 8086:0b07&lt;br /&gt;
 Resetting Intel(R) RealSense(TM) Depth Camera 435 ... ok&lt;br /&gt;
&lt;br /&gt;
Then the device works again:&lt;br /&gt;
 $ rs-enumerate-devices -s&lt;br /&gt;
Device Name                   Serial Number       Firmware Version&lt;br /&gt;
Intel RealSense D435          013222070878        5.17.0.10&lt;br /&gt;
&lt;br /&gt;
=== In a script ===&lt;br /&gt;
&lt;br /&gt;
If one Realsense only, then this will do&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 DEVICE_ID=$(lsusb | grep &amp;quot;RealSense&amp;quot; | awk &#039;{print $6}&#039;)&lt;br /&gt;
 if [ -z &amp;quot;$DEVICE_ID&amp;quot; ]; then&lt;br /&gt;
     echo &amp;quot;Error: RealSense device not found.&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
     echo &amp;quot;RealSense Device ID found: $DEVICE_ID&amp;quot;&lt;br /&gt;
     usbreset $DEVICE_ID&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
With more than one, then this is more appropriate:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Get all RealSense IDs into an array&lt;br /&gt;
 mapfile -t DEVICE_IDS &amp;lt; &amp;lt;(lsusb | grep &amp;quot;RealSense&amp;quot; | awk &#039;{print $6}&#039;)&lt;br /&gt;
 # Check if any devices were found&lt;br /&gt;
 if [ ${#DEVICE_IDS[@]} -eq 0 ]; then&lt;br /&gt;
     echo &amp;quot;No RealSense devices found.&amp;quot;&lt;br /&gt;
     exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 echo &amp;quot;Found ${#DEVICE_IDS[@]} RealSense device(s):&amp;quot;&lt;br /&gt;
 # Loop through the array&lt;br /&gt;
 for i in &amp;quot;${!DEVICE_IDS[@]}&amp;quot;; do&lt;br /&gt;
     ID=&amp;quot;${DEVICE_IDS[$i]}&amp;quot;&lt;br /&gt;
     usbreset $ID&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Both suggested by AI Gemini&lt;br /&gt;
&lt;br /&gt;
=== Script to automate solution ===&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8786</id>
		<title>Ricbot realsense</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8786"/>
		<updated>2026-05-15T07:14:44Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* D435 failed at reboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Intel RealSense ==&lt;br /&gt;
&lt;br /&gt;
Install &lt;br /&gt;
 sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
&lt;br /&gt;
There is a script to download and compile, e.g. on Raspberry Pi here:&lt;br /&gt;
https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md&lt;br /&gt;
&lt;br /&gt;
To install pyrealsense2 at the same time as librealsense, line 46 of the &#039;libuvc_installation.sh&#039; build script should be changed from this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release&lt;br /&gt;
to this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true&lt;br /&gt;
From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373&lt;br /&gt;
&lt;br /&gt;
=== Library and examples ===&lt;br /&gt;
&lt;br /&gt;
This is an alternative to the script above.&lt;br /&gt;
&lt;br /&gt;
 cd ~/git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j3&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Copy udev rules to udev&lt;br /&gt;
&lt;br /&gt;
 sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
All example commands start with rs-, e.g.:&lt;br /&gt;
 rs-capture&lt;br /&gt;
 rs-pointcloud&lt;br /&gt;
&lt;br /&gt;
=== Intel Librealsense ===&lt;br /&gt;
&lt;br /&gt;
Installing support for Intel librealsense.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
 sudo apt-get install freeglut3-dev&lt;br /&gt;
 sudo apt-get install xorg-dev&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
&lt;br /&gt;
I also needed to install libusb-1.0-0-dev&lt;br /&gt;
 sudo apt install libusb-1.0-0-dev&lt;br /&gt;
This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 nano CMakeLists.txt&lt;br /&gt;
add&lt;br /&gt;
 include_directories( /usr/include/libusb-1.0/ )&lt;br /&gt;
like here:&lt;br /&gt;
 cmake_minimum_required(VERSION 3.10)&lt;br /&gt;
 &lt;br /&gt;
 set( LRS_TARGET realsense2 )&lt;br /&gt;
 project( ${LRS_TARGET} LANGUAGES CXX C )&lt;br /&gt;
 &lt;br /&gt;
 # Allow librealsense2 and all of the nested project to include the main repo folder&lt;br /&gt;
 set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})&lt;br /&gt;
 include_directories(${REPO_ROOT})&lt;br /&gt;
 &#039;&#039;&#039;include_directories( /usr/include/libusb-1.0/ )&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 include(CMake/lrs_options.cmake)&lt;br /&gt;
 include(CMake/connectivity_check.cmake)&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
== D435 failed at reboot ==&lt;br /&gt;
&lt;br /&gt;
The RealSense D435 is connected to a powered USB3 hub.&lt;br /&gt;
The Raspberry is powered by a 5V supply through expansion pins.&lt;br /&gt;
It is a default 64-bit Raspberry Pi OS:&lt;br /&gt;
 $ cat /etc/os-release &lt;br /&gt;
 PRETTY_NAME=&amp;quot;Debian GNU/Linux 12 (bookworm)&amp;quot;&lt;br /&gt;
 NAME=&amp;quot;Debian GNU/Linux&amp;quot;&lt;br /&gt;
 VERSION_ID=&amp;quot;12&amp;quot;&lt;br /&gt;
 VERSION=&amp;quot;12 (bookworm)&amp;quot;&lt;br /&gt;
 VERSION_CODENAME=bookworm&lt;br /&gt;
 ID=debian&lt;br /&gt;
&lt;br /&gt;
=== The error ===&lt;br /&gt;
At times (after reboot), I can no longer enumerate RealSense devices, and I get:&lt;br /&gt;
 $ rs-enumerate-devices &lt;br /&gt;
 15/05 09:00:33,247 ERROR [140732254925120] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY&lt;br /&gt;
 15/05 09:00:33,249 ERROR [140732304337472] (uvc-sensor.cpp:428) acquire_power failed: failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_create_device( info_list:0x555598c13730, index:0 ) UNKNOWN] failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument &amp;quot;device&amp;quot;&lt;br /&gt;
 Could not create device - failed to set power state . Check SDK logs for details&lt;br /&gt;
 No device detected. Is it plugged in?&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&lt;br /&gt;
But &#039;&#039;lsusb&#039;&#039; finds the device&lt;br /&gt;
&lt;br /&gt;
 $ lsusb&lt;br /&gt;
 Bus 004 Device 004: ID 8086:0b07 Intel Corp. RealSense D435&lt;br /&gt;
 Bus 004 Device 005: ID 2676:ba05 Basler AG Vision Camera&lt;br /&gt;
 Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 002: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
It seems to be a boot conflict of some sort, but resetting the USB seems to work.&lt;br /&gt;
&lt;br /&gt;
From the usbutils package, run the command:&lt;br /&gt;
 $ usbreset 8086:0b07&lt;br /&gt;
 Resetting Intel(R) RealSense(TM) Depth Camera 435 ... ok&lt;br /&gt;
&lt;br /&gt;
Then the device works again:&lt;br /&gt;
 $ rs-enumerate-devices &lt;br /&gt;
 Device info: &lt;br /&gt;
    Name                          :     Intel RealSense D435&lt;br /&gt;
    Serial Number                 :     013222070878&lt;br /&gt;
    Firmware Version              :     5.17.0.10&lt;br /&gt;
    Recommended Firmware Version  :     5.17.0.10&lt;br /&gt;
    Physical Port                 :     4-1.4-7&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
=== Script to automate solution ===&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8785</id>
		<title>Ricbot realsense</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8785"/>
		<updated>2026-05-15T07:09:43Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* D435 failed at reboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Intel RealSense ==&lt;br /&gt;
&lt;br /&gt;
Install &lt;br /&gt;
 sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
&lt;br /&gt;
There is a script to download and compile, e.g. on Raspberry Pi here:&lt;br /&gt;
https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md&lt;br /&gt;
&lt;br /&gt;
To install pyrealsense2 at the same time as librealsense, line 46 of the &#039;libuvc_installation.sh&#039; build script should be changed from this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release&lt;br /&gt;
to this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true&lt;br /&gt;
From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373&lt;br /&gt;
&lt;br /&gt;
=== Library and examples ===&lt;br /&gt;
&lt;br /&gt;
This is an alternative to the script above.&lt;br /&gt;
&lt;br /&gt;
 cd ~/git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j3&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Copy udev rules to udev&lt;br /&gt;
&lt;br /&gt;
 sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
All example commands start with rs-, e.g.:&lt;br /&gt;
 rs-capture&lt;br /&gt;
 rs-pointcloud&lt;br /&gt;
&lt;br /&gt;
=== Intel Librealsense ===&lt;br /&gt;
&lt;br /&gt;
Installing support for Intel librealsense.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
 sudo apt-get install freeglut3-dev&lt;br /&gt;
 sudo apt-get install xorg-dev&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
&lt;br /&gt;
I also needed to install libusb-1.0-0-dev&lt;br /&gt;
 sudo apt install libusb-1.0-0-dev&lt;br /&gt;
This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 nano CMakeLists.txt&lt;br /&gt;
add&lt;br /&gt;
 include_directories( /usr/include/libusb-1.0/ )&lt;br /&gt;
like here:&lt;br /&gt;
 cmake_minimum_required(VERSION 3.10)&lt;br /&gt;
 &lt;br /&gt;
 set( LRS_TARGET realsense2 )&lt;br /&gt;
 project( ${LRS_TARGET} LANGUAGES CXX C )&lt;br /&gt;
 &lt;br /&gt;
 # Allow librealsense2 and all of the nested project to include the main repo folder&lt;br /&gt;
 set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})&lt;br /&gt;
 include_directories(${REPO_ROOT})&lt;br /&gt;
 &#039;&#039;&#039;include_directories( /usr/include/libusb-1.0/ )&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 include(CMake/lrs_options.cmake)&lt;br /&gt;
 include(CMake/connectivity_check.cmake)&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
== D435 failed at reboot ==&lt;br /&gt;
&lt;br /&gt;
The RealSense D435 is connected to a powered USB3 hub.&lt;br /&gt;
The Raspberry is powered by a 5V supply through expansion pins.&lt;br /&gt;
It is a default 64-bit Raspberry Pi OS:&lt;br /&gt;
 $ cat /etc/os-release &lt;br /&gt;
 PRETTY_NAME=&amp;quot;Debian GNU/Linux 12 (bookworm)&amp;quot;&lt;br /&gt;
 NAME=&amp;quot;Debian GNU/Linux&amp;quot;&lt;br /&gt;
 VERSION_ID=&amp;quot;12&amp;quot;&lt;br /&gt;
 VERSION=&amp;quot;12 (bookworm)&amp;quot;&lt;br /&gt;
 VERSION_CODENAME=bookworm&lt;br /&gt;
 ID=debian&lt;br /&gt;
&lt;br /&gt;
=== error ===&lt;br /&gt;
At times (after reboot), I can no longer enumerate RealSense devices, and I get:&lt;br /&gt;
 $ rs-enumerate-devices &lt;br /&gt;
 15/05 09:00:33,247 ERROR [140732254925120] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY&lt;br /&gt;
 15/05 09:00:33,249 ERROR [140732304337472] (uvc-sensor.cpp:428) acquire_power failed: failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_create_device( info_list:0x555598c13730, index:0 ) UNKNOWN] failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument &amp;quot;device&amp;quot;&lt;br /&gt;
 Could not create device - failed to set power state . Check SDK logs for details&lt;br /&gt;
 No device detected. Is it plugged in?&lt;br /&gt;
&lt;br /&gt;
=== lsusb ===&lt;br /&gt;
&lt;br /&gt;
But &#039;&#039;lsusb&#039;&#039; find the device&lt;br /&gt;
&lt;br /&gt;
 $ lsusb&lt;br /&gt;
 Bus 004 Device 004: ID 8086:0b07 Intel Corp. RealSense D435&lt;br /&gt;
 Bus 004 Device 005: ID 2676:ba05 Basler AG Vision Camera&lt;br /&gt;
 Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 002: ID 05e3:0626 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub&lt;br /&gt;
 Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub&lt;br /&gt;
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8784</id>
		<title>Ricbot realsense</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8784"/>
		<updated>2026-05-15T07:04:19Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Intel RealSense ==&lt;br /&gt;
&lt;br /&gt;
Install &lt;br /&gt;
 sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
&lt;br /&gt;
There is a script to download and compile, e.g. on Raspberry Pi here:&lt;br /&gt;
https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md&lt;br /&gt;
&lt;br /&gt;
To install pyrealsense2 at the same time as librealsense, line 46 of the &#039;libuvc_installation.sh&#039; build script should be changed from this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release&lt;br /&gt;
to this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true&lt;br /&gt;
From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373&lt;br /&gt;
&lt;br /&gt;
=== Library and examples ===&lt;br /&gt;
&lt;br /&gt;
This is an alternative to the script above.&lt;br /&gt;
&lt;br /&gt;
 cd ~/git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j3&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Copy udev rules to udev&lt;br /&gt;
&lt;br /&gt;
 sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
All example commands start with rs-, e.g.:&lt;br /&gt;
 rs-capture&lt;br /&gt;
 rs-pointcloud&lt;br /&gt;
&lt;br /&gt;
=== Intel Librealsense ===&lt;br /&gt;
&lt;br /&gt;
Installing support for Intel librealsense.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
 sudo apt-get install freeglut3-dev&lt;br /&gt;
 sudo apt-get install xorg-dev&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
&lt;br /&gt;
I also needed to install libusb-1.0-0-dev&lt;br /&gt;
 sudo apt install libusb-1.0-0-dev&lt;br /&gt;
This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 nano CMakeLists.txt&lt;br /&gt;
add&lt;br /&gt;
 include_directories( /usr/include/libusb-1.0/ )&lt;br /&gt;
like here:&lt;br /&gt;
 cmake_minimum_required(VERSION 3.10)&lt;br /&gt;
 &lt;br /&gt;
 set( LRS_TARGET realsense2 )&lt;br /&gt;
 project( ${LRS_TARGET} LANGUAGES CXX C )&lt;br /&gt;
 &lt;br /&gt;
 # Allow librealsense2 and all of the nested project to include the main repo folder&lt;br /&gt;
 set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})&lt;br /&gt;
 include_directories(${REPO_ROOT})&lt;br /&gt;
 &#039;&#039;&#039;include_directories( /usr/include/libusb-1.0/ )&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 include(CMake/lrs_options.cmake)&lt;br /&gt;
 include(CMake/connectivity_check.cmake)&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
== D435 failed at reboot ==&lt;br /&gt;
&lt;br /&gt;
at times (after reboot) I can no longer enumerate realsense devices, I get&lt;br /&gt;
&lt;br /&gt;
 $ rs-enumerate-devices &lt;br /&gt;
 15/05 09:00:33,247 ERROR [140732254925120] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY&lt;br /&gt;
 15/05 09:00:33,249 ERROR [140732304337472] (uvc-sensor.cpp:428) acquire_power failed: failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_create_device( info_list:0x555598c13730, index:0 ) UNKNOWN] failed to set power state&lt;br /&gt;
 15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument &amp;quot;device&amp;quot;&lt;br /&gt;
 Could not create device - failed to set power state . Check SDK logs for details&lt;br /&gt;
 No device detected. Is it plugged in?&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8783</id>
		<title>Ricbot realsense</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_realsense&amp;diff=8783"/>
		<updated>2026-05-12T13:24:51Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Library and examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Intel RealSense ==&lt;br /&gt;
&lt;br /&gt;
Install &lt;br /&gt;
 sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
&lt;br /&gt;
There is a script to download and compile, e.g. on Raspberry Pi here:&lt;br /&gt;
https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md&lt;br /&gt;
&lt;br /&gt;
To install pyrealsense2 at the same time as librealsense, line 46 of the &#039;libuvc_installation.sh&#039; build script should be changed from this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release&lt;br /&gt;
to this:&lt;br /&gt;
 cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true&lt;br /&gt;
From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373&lt;br /&gt;
&lt;br /&gt;
=== Library and examples ===&lt;br /&gt;
&lt;br /&gt;
This is an alternative to the script above.&lt;br /&gt;
&lt;br /&gt;
 cd ~/git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j3&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Copy udev rules to udev&lt;br /&gt;
&lt;br /&gt;
 sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
All example commands start with rs-, e.g.:&lt;br /&gt;
 rs-capture&lt;br /&gt;
 rs-pointcloud&lt;br /&gt;
&lt;br /&gt;
=== Intel Librealsense ===&lt;br /&gt;
&lt;br /&gt;
Installing support for Intel librealsense.&lt;br /&gt;
&lt;br /&gt;
 sudo apt install libssl-dev&lt;br /&gt;
 sudo apt-get install freeglut3-dev&lt;br /&gt;
 sudo apt-get install xorg-dev&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/IntelRealSense/librealsense.git&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
&lt;br /&gt;
I also needed to install libusb-1.0-0-dev&lt;br /&gt;
 sudo apt install libusb-1.0-0-dev&lt;br /&gt;
This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:&lt;br /&gt;
&lt;br /&gt;
 cd librealsense&lt;br /&gt;
 nano CMakeLists.txt&lt;br /&gt;
add&lt;br /&gt;
 include_directories( /usr/include/libusb-1.0/ )&lt;br /&gt;
like here:&lt;br /&gt;
 cmake_minimum_required(VERSION 3.10)&lt;br /&gt;
 &lt;br /&gt;
 set( LRS_TARGET realsense2 )&lt;br /&gt;
 project( ${LRS_TARGET} LANGUAGES CXX C )&lt;br /&gt;
 &lt;br /&gt;
 # Allow librealsense2 and all of the nested project to include the main repo folder&lt;br /&gt;
 set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})&lt;br /&gt;
 include_directories(${REPO_ROOT})&lt;br /&gt;
 &#039;&#039;&#039;include_directories( /usr/include/libusb-1.0/ )&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 include(CMake/lrs_options.cmake)&lt;br /&gt;
 include(CMake/connectivity_check.cmake)&lt;br /&gt;
 ...&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_install_on_Raspberry&amp;diff=8782</id>
		<title>Robobot install on Raspberry</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_install_on_Raspberry&amp;diff=8782"/>
		<updated>2026-05-11T07:25:49Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Additional packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry installation notes ==&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi recommended 64-bit OS is &#039;&#039;Debian GNU/Linux 13 (trixie)&#039;&#039; (2025)&lt;br /&gt;
&lt;br /&gt;
[[Raspberry base install]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, if ROS2 is needed, install Ubuntu (but a bit more complicated)&lt;br /&gt;
&lt;br /&gt;
=== Install Raspberry on blank SD-card ===&lt;br /&gt;
&lt;br /&gt;
Use Raspberry Pi Imager &lt;br /&gt;
(download from https://www.raspberrypi.com/software/)&lt;br /&gt;
&lt;br /&gt;
 rpi-imager&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select operating system&#039;&#039;&#039; &#039;Raspberry Pi OS (64bit)&#039; and &#039;&#039;&#039;storage&#039;&#039;&#039;, an empty SD-flash of at least 16GB.&lt;br /&gt;
&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
Edit settings: set: &lt;br /&gt;
&lt;br /&gt;
* Hostname (e.g. robobot)&lt;br /&gt;
* Username (local) and password (remember to spell the password correctly).&lt;br /&gt;
* SSID (DTUdevice), and associated password&lt;br /&gt;
* Time zone (Europe/Copenhagen)&lt;br /&gt;
* Danish keyboard&lt;br /&gt;
* In &#039;&#039;Services&#039;&#039;, enable SSH.&lt;br /&gt;
&lt;br /&gt;
Then yes, yes.&lt;br /&gt;
&lt;br /&gt;
When finished, mount the SD into the Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
=== Get in contact with Raspberry ===&lt;br /&gt;
&lt;br /&gt;
If everything is configured as above, you just need to determine the IP.&lt;br /&gt;
On a Linux computer, you can find the Raspberry Pi&#039;s IP address using (if on the same local network):&lt;br /&gt;
&lt;br /&gt;
 sudo apt install net-tools nmap&lt;br /&gt;
 nmap -sP 192.168.2.0/24&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
You need a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
Log on to the Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
 $ ifconfig&lt;br /&gt;
 eth0: flags=4099&amp;lt;UP,BROADCAST,MULTICAST&amp;gt;  mtu 1500&lt;br /&gt;
   ...&lt;br /&gt;
 lo: flags=73&amp;lt;UP,LOOPBACK,RUNNING&amp;gt;  mtu 65536&lt;br /&gt;
   ...&lt;br /&gt;
 wlan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1500&lt;br /&gt;
        inet 10.197.217.175  netmask 255.255.252.0  broadcast 10.197.219.255&lt;br /&gt;
        inet6 fe80::f620:b431:69cc:44f4  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
        ether dc:a6:32:f4:0e:a4  txqueuelen 1000  (Ethernet)&lt;br /&gt;
        RX packets 486  bytes 41505 (40.5 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 421  bytes 43403 (42.3 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this case, the IP4 (inet) is 10.197.217.175.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t get an IP address, the Wi-Fi may not be set correctly (see the [[Network setup]]).&lt;br /&gt;
&lt;br /&gt;
===Additional packages===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 libreadline-dev&lt;br /&gt;
 libopencv-dev&lt;br /&gt;
 libgpiod-dev&lt;br /&gt;
 gpiod&lt;br /&gt;
 cmake&lt;br /&gt;
 subversion&lt;br /&gt;
 aptitude&lt;br /&gt;
 telnet&lt;br /&gt;
 ntp       (better to use timesyncd)&lt;br /&gt;
 ntpdate   (       --              )&lt;br /&gt;
 nmap&lt;br /&gt;
 lsof&lt;br /&gt;
 net-tools&lt;br /&gt;
 libpaho-mqtt-dev &lt;br /&gt;
 libpaho-mqttpp-dev (if not available, then not needed)&lt;br /&gt;
 python3-paho-mqtt&lt;br /&gt;
 python3-opencv&lt;br /&gt;
 python3-setproctitle&lt;br /&gt;
 mosquito&lt;br /&gt;
 mosquitto-dev &lt;br /&gt;
 mosquitto-clients&lt;br /&gt;
 libusb-dev&lt;br /&gt;
 libcli11-dev    (maybe not available)&lt;br /&gt;
 libssl-dev&lt;br /&gt;
 libcpp-httplib-dev (for video streamer only)&lt;br /&gt;
 libpcl-dev         (may not be needed - 3D pointcloud lib)&lt;br /&gt;
 sudo apt install libreadline-dev libopencv-dev libgpiod-dev gpiod cmake subversion aptitude telnet nmap lsof python3-paho-mqtt libpaho-mqtt-dev python3-opencv python3-setproctitle mosquitto mosquitto-dev mosquitto-clients libusb-dev libcli11-dev net-tools libssl-dev libcpp-httplib-dev libpcl-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and, if libcli11-dev is not available&lt;br /&gt;
&lt;br /&gt;
Install command line interface library (if not found by &#039;apt install libcli11-dev&#039;)&lt;br /&gt;
 cd&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/CLIUtils/CLI11.git&lt;br /&gt;
&lt;br /&gt;
The library is &#039;header-only&#039;, and the makefile for Raspberry looks in ~/git/CLI11 for the file, so no need to build.&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu additional ====&lt;br /&gt;
&lt;br /&gt;
Install also:&lt;br /&gt;
 build-essential&lt;br /&gt;
 net-tools&lt;br /&gt;
 openssh-server&lt;br /&gt;
 grub-mkconfig  (not found)&lt;br /&gt;
 git&lt;br /&gt;
 sudo apt install net-tools openssh-server git build-essential&lt;br /&gt;
&lt;br /&gt;
The ssh server needs to be enabled&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
&lt;br /&gt;
The grub-mkconfig command can be used to update the startup behaviour, e.g., to terminal-only.&lt;br /&gt;
Edit the /etc/default/grub, make the changes, and then update the boot&lt;br /&gt;
 sudo grub-mkconfig -o /boot/grub/grub.cfg&lt;br /&gt;
but not found&lt;br /&gt;
&lt;br /&gt;
=== Configure Mosquitto ===&lt;br /&gt;
&lt;br /&gt;
At installation, the Mosquitto server does not allow remote access.&lt;br /&gt;
&lt;br /&gt;
A complete configuration file can be found here: https://github.com/eclipse-mosquitto/mosquitto/tree/master&lt;br /&gt;
&lt;br /&gt;
Only two options are needed, so we make a set of local options:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/mosquitto/conf.d/robobot.conf&lt;br /&gt;
&lt;br /&gt;
Insert these lines (insert from clipboard is Ctrl+Shift+v in nano)&lt;br /&gt;
 listener 1883&lt;br /&gt;
 allow_anonymous true&lt;br /&gt;
&lt;br /&gt;
Save and restart mosquito&lt;br /&gt;
&lt;br /&gt;
 sudo service mosquitto restart&lt;br /&gt;
&lt;br /&gt;
More details here [[MQTT_and_Mosquitto]]&lt;br /&gt;
&lt;br /&gt;
=== Configure serial port /dev/ttyACM0 ===&lt;br /&gt;
&lt;br /&gt;
At times, a serial port echoes what is received. This creates an endless loop, as the Teensy sends a reply, if something is not understood.&lt;br /&gt;
This is a configuration of the port; see the settings using stty:&lt;br /&gt;
&lt;br /&gt;
 stty -a -F /dev/ttyACM0&lt;br /&gt;
  &#039;&#039;speed 9600 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
  &#039;&#039;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
  &#039;&#039;stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;&lt;br /&gt;
  &#039;&#039;-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts&lt;br /&gt;
  &#039;&#039;-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8&lt;br /&gt;
  &#039;&#039;-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
  &#039;&#039;-isig -icanon iexten &#039;&#039;&#039;-echo&#039;&#039;&#039; -echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Especially &#039;&#039;echo&#039;&#039; (last line) must have a &#039;-&#039; in front. However, other types of handshake, such as &#039;ixoff&#039;, should be disabled as well.&lt;br /&gt;
This can all be set by:&lt;br /&gt;
&lt;br /&gt;
 stty -F /dev/ttyACM0 raw -echo -echoe&lt;br /&gt;
&lt;br /&gt;
When installing the &#039;&#039;udev&#039;&#039; rule for Teensy devices, then the above command is executed when a Teensy device is detected.&lt;br /&gt;
See [[Arduino_and_Teensy_libraries#Add_Teensy_board_support]].&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;udev&#039;&#039; rule is included in &#039;&#039;robobot/setup&#039;&#039; directory as &#039;&#039;00-teensy.rules&#039;&#039;, is should be copied to /etc/udev&lt;br /&gt;
 sudo cp ~/svn/robobot/setup/00-teensy.rules /etc/udev/rules.d/&lt;br /&gt;
The file contains&lt;br /&gt;
&lt;br /&gt;
 # UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/&lt;br /&gt;
 #&lt;br /&gt;
 # The latest version of this file may be found at:&lt;br /&gt;
 #   http://www.pjrc.com/teensy/00-teensy.rules&lt;br /&gt;
 #&lt;br /&gt;
 # This file must be placed at:&lt;br /&gt;
 #&lt;br /&gt;
 # /etc/udev/rules.d/00-teensy.rules    (preferred location)&lt;br /&gt;
 #   or&lt;br /&gt;
 # /lib/udev/rules.d/00-teensy.rules    (req&#039;d on some broken systems)&lt;br /&gt;
 #&lt;br /&gt;
 # To install, type this command in a terminal:&lt;br /&gt;
 #   sudo cp 00-teensy.rules /etc/udev/rules.d/00-teensy.rules&lt;br /&gt;
 #&lt;br /&gt;
 # After this file is installed, physically unplug and reconnect Teensy.&lt;br /&gt;
 #&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, ENV{ID_MM_DEVICE_IGNORE}=&amp;quot;1&amp;quot;, ENV{ID_MM_PORT_IGNORE}=&amp;quot;1&amp;quot;&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04[789a]*&amp;quot;, ENV{MTP_NO_PROBE}=&amp;quot;1&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;ttyACM*&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;, RUN:=&amp;quot;/bin/stty -F /dev/%k raw -echo&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;hidraw*&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;hidraw*&amp;quot;, ATTRS{idVendor}==&amp;quot;1fc9&amp;quot;, ATTRS{idProduct}==&amp;quot;013*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;1fc9&amp;quot;, ATTRS{idProduct}==&amp;quot;013*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # If you share your Linux system with other users, or just don&#039;t like the&lt;br /&gt;
 # idea of write permission for everybody, you can replace MODE:=&amp;quot;0666&amp;quot; with&lt;br /&gt;
 # OWNER:=&amp;quot;yourusername&amp;quot; to create the device owned by you, or with&lt;br /&gt;
 # GROUP:=&amp;quot;somegroupname&amp;quot; and manage access using standard Unix groups.&lt;br /&gt;
 #&lt;br /&gt;
 # ModemManager tends to interfere with USB Serial devices like Teensy.&lt;br /&gt;
 # Problems manifest as the Arduino Serial Monitor missing some incoming&lt;br /&gt;
 # data, and &amp;quot;Unable to open /dev/ttyACM0 for reboot request&amp;quot; when&lt;br /&gt;
 # uploading. If you experience these problems, disable or remove&lt;br /&gt;
 # ModemManager from your system. If you must use a modem, perhaps&lt;br /&gt;
 # try disabling the &amp;quot;MM_FILTER_RULE_TTY_ACM_INTERFACE&amp;quot; ModemManager&lt;br /&gt;
 # rule. Changing ModemManager&#039;s filter policy from &amp;quot;strict&amp;quot; to &amp;quot;default&amp;quot;&lt;br /&gt;
 # may also help. But if you don&#039;t use a modem, completely removing&lt;br /&gt;
 # the troublesome ModemManager is the most effective solution.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Robobot_install_on_Raspberry&amp;diff=8781</id>
		<title>Robobot install on Raspberry</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Robobot_install_on_Raspberry&amp;diff=8781"/>
		<updated>2026-05-10T13:24:24Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Additional packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry installation notes ==&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi recommended 64-bit OS is &#039;&#039;Debian GNU/Linux 13 (trixie)&#039;&#039; (2025)&lt;br /&gt;
&lt;br /&gt;
[[Raspberry base install]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, if ROS2 is needed, install Ubuntu (but a bit more complicated)&lt;br /&gt;
&lt;br /&gt;
=== Install Raspberry on blank SD-card ===&lt;br /&gt;
&lt;br /&gt;
Use Raspberry Pi Imager &lt;br /&gt;
(download from https://www.raspberrypi.com/software/)&lt;br /&gt;
&lt;br /&gt;
 rpi-imager&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select operating system&#039;&#039;&#039; &#039;Raspberry Pi OS (64bit)&#039; and &#039;&#039;&#039;storage&#039;&#039;&#039;, an empty SD-flash of at least 16GB.&lt;br /&gt;
&lt;br /&gt;
Next&lt;br /&gt;
&lt;br /&gt;
Edit settings: set: &lt;br /&gt;
&lt;br /&gt;
* Hostname (e.g. robobot)&lt;br /&gt;
* Username (local) and password (remember to spell the password correctly).&lt;br /&gt;
* SSID (DTUdevice), and associated password&lt;br /&gt;
* Time zone (Europe/Copenhagen)&lt;br /&gt;
* Danish keyboard&lt;br /&gt;
* In &#039;&#039;Services&#039;&#039;, enable SSH.&lt;br /&gt;
&lt;br /&gt;
Then yes, yes.&lt;br /&gt;
&lt;br /&gt;
When finished, mount the SD into the Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
=== Get in contact with Raspberry ===&lt;br /&gt;
&lt;br /&gt;
If everything is configured as above, you just need to determine the IP.&lt;br /&gt;
On a Linux computer, you can find the Raspberry Pi&#039;s IP address using (if on the same local network):&lt;br /&gt;
&lt;br /&gt;
 sudo apt install net-tools nmap&lt;br /&gt;
 nmap -sP 192.168.2.0/24&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
You need a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
Log on to the Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
 $ ifconfig&lt;br /&gt;
 eth0: flags=4099&amp;lt;UP,BROADCAST,MULTICAST&amp;gt;  mtu 1500&lt;br /&gt;
   ...&lt;br /&gt;
 lo: flags=73&amp;lt;UP,LOOPBACK,RUNNING&amp;gt;  mtu 65536&lt;br /&gt;
   ...&lt;br /&gt;
 wlan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1500&lt;br /&gt;
        inet 10.197.217.175  netmask 255.255.252.0  broadcast 10.197.219.255&lt;br /&gt;
        inet6 fe80::f620:b431:69cc:44f4  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
        ether dc:a6:32:f4:0e:a4  txqueuelen 1000  (Ethernet)&lt;br /&gt;
        RX packets 486  bytes 41505 (40.5 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 421  bytes 43403 (42.3 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this case, the IP4 (inet) is 10.197.217.175.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t get an IP address, the Wi-Fi may not be set correctly (see the [[Network setup]]).&lt;br /&gt;
&lt;br /&gt;
===Additional packages===&lt;br /&gt;
&lt;br /&gt;
Install the following packages:&lt;br /&gt;
 libreadline-dev&lt;br /&gt;
 libopencv-dev&lt;br /&gt;
 libgpiod-dev&lt;br /&gt;
 gpiod&lt;br /&gt;
 cmake&lt;br /&gt;
 subversion&lt;br /&gt;
 aptitude&lt;br /&gt;
 telnet&lt;br /&gt;
 ntp       (better to use timesyncd)&lt;br /&gt;
 ntpdate   (       --              )&lt;br /&gt;
 nmap&lt;br /&gt;
 lsof&lt;br /&gt;
 net-tools&lt;br /&gt;
 libpaho-mqtt-dev &lt;br /&gt;
 libpaho-mqttpp-dev (if not available, then not needed)&lt;br /&gt;
 python3-paho-mqtt&lt;br /&gt;
 python3-opencv&lt;br /&gt;
 python3-setproctitle&lt;br /&gt;
 mosquito&lt;br /&gt;
 mosquitto-dev &lt;br /&gt;
 mosquitto-clients&lt;br /&gt;
 libusb-dev&lt;br /&gt;
 libcli11-dev    (maybe not available)&lt;br /&gt;
 libssl-dev&lt;br /&gt;
 libcpp-httplib-dev&lt;br /&gt;
 sudo apt install libreadline-dev libopencv-dev libgpiod-dev gpiod cmake subversion aptitude telnet nmap lsof python3-paho-mqtt libpaho-mqtt-dev python3-opencv python3-setproctitle mosquitto mosquitto-dev mosquitto-clients libusb-dev libcli11-dev net-tools libssl-dev libcpp-httplib-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and, if libcli11-dev is not available&lt;br /&gt;
&lt;br /&gt;
Install command line interface library (if not found by &#039;apt install libcli11-dev&#039;)&lt;br /&gt;
 cd&lt;br /&gt;
 cd git&lt;br /&gt;
 git clone https://github.com/CLIUtils/CLI11.git&lt;br /&gt;
&lt;br /&gt;
The library is &#039;header-only&#039;, and the makefile for Raspberry looks in ~/git/CLI11 for the file, so no need to build.&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu additional ====&lt;br /&gt;
&lt;br /&gt;
Install also:&lt;br /&gt;
 build-essential&lt;br /&gt;
 net-tools&lt;br /&gt;
 openssh-server&lt;br /&gt;
 grub-mkconfig  (not found)&lt;br /&gt;
 git&lt;br /&gt;
 sudo apt install net-tools openssh-server git build-essential&lt;br /&gt;
&lt;br /&gt;
The ssh server needs to be enabled&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
&lt;br /&gt;
The grub-mkconfig command can be used to update the startup behaviour, e.g., to terminal-only.&lt;br /&gt;
Edit the /etc/default/grub, make the changes, and then update the boot&lt;br /&gt;
 sudo grub-mkconfig -o /boot/grub/grub.cfg&lt;br /&gt;
but not found&lt;br /&gt;
&lt;br /&gt;
=== Configure Mosquitto ===&lt;br /&gt;
&lt;br /&gt;
At installation, the Mosquitto server does not allow remote access.&lt;br /&gt;
&lt;br /&gt;
A complete configuration file can be found here: https://github.com/eclipse-mosquitto/mosquitto/tree/master&lt;br /&gt;
&lt;br /&gt;
Only two options are needed, so we make a set of local options:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/mosquitto/conf.d/robobot.conf&lt;br /&gt;
&lt;br /&gt;
Insert these lines (insert from clipboard is Ctrl+Shift+v in nano)&lt;br /&gt;
 listener 1883&lt;br /&gt;
 allow_anonymous true&lt;br /&gt;
&lt;br /&gt;
Save and restart mosquito&lt;br /&gt;
&lt;br /&gt;
 sudo service mosquitto restart&lt;br /&gt;
&lt;br /&gt;
More details here [[MQTT_and_Mosquitto]]&lt;br /&gt;
&lt;br /&gt;
=== Configure serial port /dev/ttyACM0 ===&lt;br /&gt;
&lt;br /&gt;
At times, a serial port echoes what is received. This creates an endless loop, as the Teensy sends a reply, if something is not understood.&lt;br /&gt;
This is a configuration of the port; see the settings using stty:&lt;br /&gt;
&lt;br /&gt;
 stty -a -F /dev/ttyACM0&lt;br /&gt;
  &#039;&#039;speed 9600 baud; rows 0; columns 0; line = 0;&lt;br /&gt;
  &#039;&#039;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;; eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q;&lt;br /&gt;
  &#039;&#039;stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;&lt;br /&gt;
  &#039;&#039;-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts&lt;br /&gt;
  &#039;&#039;-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8&lt;br /&gt;
  &#039;&#039;-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0&lt;br /&gt;
  &#039;&#039;-isig -icanon iexten &#039;&#039;&#039;-echo&#039;&#039;&#039; -echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Especially &#039;&#039;echo&#039;&#039; (last line) must have a &#039;-&#039; in front. However, other types of handshake, such as &#039;ixoff&#039;, should be disabled as well.&lt;br /&gt;
This can all be set by:&lt;br /&gt;
&lt;br /&gt;
 stty -F /dev/ttyACM0 raw -echo -echoe&lt;br /&gt;
&lt;br /&gt;
When installing the &#039;&#039;udev&#039;&#039; rule for Teensy devices, then the above command is executed when a Teensy device is detected.&lt;br /&gt;
See [[Arduino_and_Teensy_libraries#Add_Teensy_board_support]].&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;udev&#039;&#039; rule is included in &#039;&#039;robobot/setup&#039;&#039; directory as &#039;&#039;00-teensy.rules&#039;&#039;, is should be copied to /etc/udev&lt;br /&gt;
 sudo cp ~/svn/robobot/setup/00-teensy.rules /etc/udev/rules.d/&lt;br /&gt;
The file contains&lt;br /&gt;
&lt;br /&gt;
 # UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/&lt;br /&gt;
 #&lt;br /&gt;
 # The latest version of this file may be found at:&lt;br /&gt;
 #   http://www.pjrc.com/teensy/00-teensy.rules&lt;br /&gt;
 #&lt;br /&gt;
 # This file must be placed at:&lt;br /&gt;
 #&lt;br /&gt;
 # /etc/udev/rules.d/00-teensy.rules    (preferred location)&lt;br /&gt;
 #   or&lt;br /&gt;
 # /lib/udev/rules.d/00-teensy.rules    (req&#039;d on some broken systems)&lt;br /&gt;
 #&lt;br /&gt;
 # To install, type this command in a terminal:&lt;br /&gt;
 #   sudo cp 00-teensy.rules /etc/udev/rules.d/00-teensy.rules&lt;br /&gt;
 #&lt;br /&gt;
 # After this file is installed, physically unplug and reconnect Teensy.&lt;br /&gt;
 #&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, ENV{ID_MM_DEVICE_IGNORE}=&amp;quot;1&amp;quot;, ENV{ID_MM_PORT_IGNORE}=&amp;quot;1&amp;quot;&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04[789a]*&amp;quot;, ENV{MTP_NO_PROBE}=&amp;quot;1&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;ttyACM*&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;, RUN:=&amp;quot;/bin/stty -F /dev/%k raw -echo&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;hidraw*&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;16c0&amp;quot;, ATTRS{idProduct}==&amp;quot;04*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 KERNEL==&amp;quot;hidraw*&amp;quot;, ATTRS{idVendor}==&amp;quot;1fc9&amp;quot;, ATTRS{idProduct}==&amp;quot;013*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;1fc9&amp;quot;, ATTRS{idProduct}==&amp;quot;013*&amp;quot;, MODE:=&amp;quot;0666&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # If you share your Linux system with other users, or just don&#039;t like the&lt;br /&gt;
 # idea of write permission for everybody, you can replace MODE:=&amp;quot;0666&amp;quot; with&lt;br /&gt;
 # OWNER:=&amp;quot;yourusername&amp;quot; to create the device owned by you, or with&lt;br /&gt;
 # GROUP:=&amp;quot;somegroupname&amp;quot; and manage access using standard Unix groups.&lt;br /&gt;
 #&lt;br /&gt;
 # ModemManager tends to interfere with USB Serial devices like Teensy.&lt;br /&gt;
 # Problems manifest as the Arduino Serial Monitor missing some incoming&lt;br /&gt;
 # data, and &amp;quot;Unable to open /dev/ttyACM0 for reboot request&amp;quot; when&lt;br /&gt;
 # uploading. If you experience these problems, disable or remove&lt;br /&gt;
 # ModemManager from your system. If you must use a modem, perhaps&lt;br /&gt;
 # try disabling the &amp;quot;MM_FILTER_RULE_TTY_ACM_INTERFACE&amp;quot; ModemManager&lt;br /&gt;
 # rule. Changing ModemManager&#039;s filter policy from &amp;quot;strict&amp;quot; to &amp;quot;default&amp;quot;&lt;br /&gt;
 # may also help. But if you don&#039;t use a modem, completely removing&lt;br /&gt;
 # the troublesome ModemManager is the most effective solution.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8780</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8780"/>
		<updated>2026-04-28T07:24:16Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Home network connection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
==== As its own hotspot ====&lt;br /&gt;
&lt;br /&gt;
See [[RICbot Hotspot | hotspot]].&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8779</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8779"/>
		<updated>2026-04-28T07:23:40Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* As its own hotspot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
==== As its own hotspot ====&lt;br /&gt;
&lt;br /&gt;
See [[RICbot Hotspot | hotspot]].&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8778</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8778"/>
		<updated>2026-04-28T07:23:29Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* As its own hotspot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
==== As its own hotspot ====&lt;br /&gt;
&lt;br /&gt;
See [[RICbot Hotspot | hotspot]]&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8777</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8777"/>
		<updated>2026-04-28T07:20:08Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Network Manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
==== As its own hotspot ====&lt;br /&gt;
&lt;br /&gt;
See [[Ricbot hotspot | hotspot]]&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8776</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8776"/>
		<updated>2026-04-28T07:12:32Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Home network connection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli dev wifi&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
==== As its own hotspot ====&lt;br /&gt;
&lt;br /&gt;
See [[Ricbot hotspot | hotspot]]&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8775</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8775"/>
		<updated>2026-04-28T07:05:18Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Back to [[Ricbot]]&lt;br /&gt;
* Back to [[Robobot_B | Robobot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager does it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid raspberry password pipiAnika&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;br /&gt;
&lt;br /&gt;
All other established wifi connections (with autoconnect=true) will then be attempted first.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8774</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8774"/>
		<updated>2026-04-28T07:05:04Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
Back to [[Robobot_B | Robobot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager does it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid raspberry password pipiAnika&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;br /&gt;
&lt;br /&gt;
All other established wifi connections (with autoconnect=true) will then be attempted first.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8773</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8773"/>
		<updated>2026-04-28T07:04:51Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
Back to [[Robobot_B | Robobot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager does it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid raspberry password pipiAnika&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;br /&gt;
&lt;br /&gt;
All other established wifi connections (with autoconnect=true) will then be attempted first.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8772</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8772"/>
		<updated>2026-04-28T07:04:09Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Network manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager does it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid raspberry password pipiAnika&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;br /&gt;
&lt;br /&gt;
All other established wifi connections (with autoconnect=true) will then be attempted first.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8771</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8771"/>
		<updated>2026-04-28T07:02:35Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Network manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager does it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid raspberry password pipiAnika&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8770</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8770"/>
		<updated>2026-04-28T06:59:35Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Raspberry hotspot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager do it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid &amp;lt;example-network-name&amp;gt; password &amp;lt;example-password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, &#039;&#039;&#039;replace&#039;&#039;&#039; &#039;&#039;autoconnect=false&#039;&#039; with&lt;br /&gt;
 autoconnect-priority=-50&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8769</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8769"/>
		<updated>2026-04-28T06:59:08Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Network manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager do it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid &amp;lt;example-network-name&amp;gt; password &amp;lt;example-password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # default setup without priority&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
Set autoconnect to true and add a priority line to make this the last-resort priority (low negative value).&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/NetworkManager/system-connections/Hotspot.nmconnection&lt;br /&gt;
 # In the [connection] group, replace autoconnect=false with&lt;br /&gt;
 autoconnect-priority=-50&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8768</id>
		<title>RICbot Hotspot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RICbot_Hotspot&amp;diff=8768"/>
		<updated>2026-04-28T06:36:34Z</updated>

		<summary type="html">&lt;p&gt;Jca: Created page with &amp;quot;Back to Ricbot  == Raspberry hotspot ==  If Wi-Fi is not available, then start your own hotspot.  === Network manager ===  Network Manager do it all in one go:   sudo nmcli device wifi hotspot ssid &amp;lt;example-network-name&amp;gt; password &amp;lt;example-password&amp;gt;  This will also make an entry in &amp;#039;&amp;#039;/etc/NetworkManager/system-connections/&amp;#039;&amp;#039; called &amp;#039;&amp;#039;Hotspot.nmconnection&amp;#039;&amp;#039;   [connection]  id=Hotspot  uuid=407d1e04-7971-4c33-9a71-c760c803ce9b  type=wifi  autoconnect=false  interface-na...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Raspberry hotspot ==&lt;br /&gt;
&lt;br /&gt;
If Wi-Fi is not available, then start your own hotspot.&lt;br /&gt;
&lt;br /&gt;
=== Network manager ===&lt;br /&gt;
&lt;br /&gt;
Network Manager do it all in one go:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi hotspot ssid &amp;lt;example-network-name&amp;gt; password &amp;lt;example-password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will also make an entry in &#039;&#039;/etc/NetworkManager/system-connections/&#039;&#039; called &#039;&#039;Hotspot.nmconnection&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Hotspot&lt;br /&gt;
 uuid=407d1e04-7971-4c33-9a71-c760c803ce9b&lt;br /&gt;
 type=wifi&lt;br /&gt;
 autoconnect=false&lt;br /&gt;
 interface-name=wlan0&lt;br /&gt;
 &lt;br /&gt;
 [wifi]&lt;br /&gt;
 mode=ap&lt;br /&gt;
 ssid=raspberry&lt;br /&gt;
 &lt;br /&gt;
 [wifi-security]&lt;br /&gt;
 group=ccmp;&lt;br /&gt;
 key-mgmt=wpa-psk&lt;br /&gt;
 pairwise=ccmp;&lt;br /&gt;
 proto=rsn;&lt;br /&gt;
 psk=pipiAnika&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=shared&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=ignore&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8767</id>
		<title>Ricbot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8767"/>
		<updated>2026-04-28T06:29:00Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Installation notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Ricbot, a wheeled sensor platform == &lt;br /&gt;
&lt;br /&gt;
Ricbot is intended for fast deployment to areas of interest.&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* Reused motors and wheels from an old &amp;quot;Elector Wheelie&amp;quot; platform&lt;br /&gt;
* Designed to fit into a normal car for deployment, i.e can be disassembled to no more than 55cm in height.&lt;br /&gt;
* No more than 25-30 kg, requiring 1 or 2 persons to load or unload.&lt;br /&gt;
* Wheel-odometry recording (and timestamped)&lt;br /&gt;
* Camera image recording (and timestamped), the intention is Realsense D435.&lt;br /&gt;
* Maybe GNSS recording too.&lt;br /&gt;
* Manual remote control.&lt;br /&gt;
&lt;br /&gt;
== User support ==&lt;br /&gt;
&lt;br /&gt;
* [[RIC start and stop | Start, drive and stop]]&lt;br /&gt;
* [[RIC data recording | Data recording]]&lt;br /&gt;
&lt;br /&gt;
== Installation notes == &lt;br /&gt;
&lt;br /&gt;
* [[Ricbot hardware]]&lt;br /&gt;
* Ricbot installation of [[Ricbot realsense | Realsense]]&lt;br /&gt;
* [[Ricbot ROS2 | ROS2]] including bridge from MQTT to ROS2 messaging&lt;br /&gt;
* [[Ricbot GNSS | GNSS]] installation, including &#039;gpsd&#039;&lt;br /&gt;
* [[Ricbot PTP | PTP]] time synchronization.&lt;br /&gt;
* Raspberry as [[RICbot Hotspot | hotspot]].&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8766</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8766"/>
		<updated>2026-04-26T15:17:31Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Raspberry pi issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
Support added to teensy_interface (not fully tested) - part of Robobot software.&lt;br /&gt;
&lt;br /&gt;
=== Raspberry Pi issue ===&lt;br /&gt;
&lt;br /&gt;
Starting gpsd as a service fails, but manually starting it works fine:&lt;br /&gt;
 sudo gpsd -n -N -D3 /dev/ttyACM1&lt;br /&gt;
&lt;br /&gt;
Starting the service fails, like:&lt;br /&gt;
 local@Saturn:~ $ systemctl status gpsd&lt;br /&gt;
 ○ gpsd.service - GPS (Global Positioning System) Daemon&lt;br /&gt;
     Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; preset: enabled)&lt;br /&gt;
     Active: inactive (dead)&lt;br /&gt;
 TriggeredBy: × gpsd.socket&lt;br /&gt;
       Docs: man:gpsd&lt;br /&gt;
 &lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: Dependency failed for gpsd.service - GPS (Global  Positioning System) Daemon.&lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: gpsd.service: Job gpsd.service/start failed with result &#039;dependency&#039;.&lt;br /&gt;
&lt;br /&gt;
After a long search by Ecosia, I found a fix.&lt;br /&gt;
&lt;br /&gt;
The /lib/systemd/system/gpsd.socket looked like this:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 ListenStream=[::]:2947&lt;br /&gt;
 ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
Then uncommented most of these dependencies to listen to only 127.0.0.1:2947:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 #ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 #ListenStream=[::]:2947&lt;br /&gt;
 #ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 #BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
Then I could do&lt;br /&gt;
 systemctl start gpsd&lt;br /&gt;
and verify with&lt;br /&gt;
 cgps&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
&lt;br /&gt;
see: https://kickstartembedded.com/2022/07/23/a-beginners-guide-to-using-gpsd-in-linux/&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8765</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8765"/>
		<updated>2026-04-26T11:29:25Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Raspberry pi issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
Support added to teensy_interface (not fully tested) - part of Robobot software.&lt;br /&gt;
&lt;br /&gt;
=== Raspberry pi issue ===&lt;br /&gt;
&lt;br /&gt;
Starting gpsd as a service fails, but manualy start works fine:&lt;br /&gt;
 sudo gpsd -n -N -D3 /dev/ttyACM1&lt;br /&gt;
&lt;br /&gt;
Starting the service fails, like:&lt;br /&gt;
 local@Saturn:~ $ systemctl status gpsd&lt;br /&gt;
 ○ gpsd.service - GPS (Global Positioning System) Daemon&lt;br /&gt;
     Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; preset: enabled)&lt;br /&gt;
     Active: inactive (dead)&lt;br /&gt;
 TriggeredBy: × gpsd.socket&lt;br /&gt;
       Docs: man:gpsd&lt;br /&gt;
 &lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: Dependency failed for gpsd.service - GPS (Global  Positioning System) Daemon.&lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: gpsd.service: Job gpsd.service/start failed with result &#039;dependency&#039;.&lt;br /&gt;
&lt;br /&gt;
After a long search by Ecosia, I found a fix&lt;br /&gt;
&lt;br /&gt;
The /lib/systemd/system/gpsd.socket looked like this:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 ListenStream=[::]:2947&lt;br /&gt;
 ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
I the uncommented most of these dependencies to listen only to 127.0.0.1:2947:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 #ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 #ListenStream=[::]:2947&lt;br /&gt;
 #ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 #BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
Then I could do&lt;br /&gt;
 systemctl start gpsd&lt;br /&gt;
and verify with&lt;br /&gt;
 cgps&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
&lt;br /&gt;
see: https://kickstartembedded.com/2022/07/23/a-beginners-guide-to-using-gpsd-in-linux/&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8764</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8764"/>
		<updated>2026-04-26T11:28:19Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* GNSS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
Support added to teensy_interface (not fully tested) - part of Robobot software.&lt;br /&gt;
&lt;br /&gt;
=== Raspberry pi issue ===&lt;br /&gt;
&lt;br /&gt;
Starting gpsd as a service fails, but manualy start works fine:&lt;br /&gt;
 sudo gpsd -n -N -D3 /dev/ttyACM1&lt;br /&gt;
&lt;br /&gt;
Starting the service fails, like:&lt;br /&gt;
 local@Saturn:~ $ systemctl status gpsd&lt;br /&gt;
 ○ gpsd.service - GPS (Global Positioning System) Daemon&lt;br /&gt;
     Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; preset: enabled)&lt;br /&gt;
     Active: inactive (dead)&lt;br /&gt;
 TriggeredBy: × gpsd.socket&lt;br /&gt;
       Docs: man:gpsd&lt;br /&gt;
 &lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: Dependency failed for gpsd.service - GPS (Global  Positioning System) Daemon.&lt;br /&gt;
 Apr 26 13:02:52 Saturn systemd[1]: gpsd.service: Job gpsd.service/start failed with result &#039;dependency&#039;.&lt;br /&gt;
&lt;br /&gt;
After a long search by Ecosia, I found a fix&lt;br /&gt;
&lt;br /&gt;
The /lib/systemd/system/gpsd.socket looked like this:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 ListenStream=[::]:2947&lt;br /&gt;
 ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
I the uncommented most of these dependecies to:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=GPS (Global Positioning System) Daemon Sockets&lt;br /&gt;
 &lt;br /&gt;
 [Socket]&lt;br /&gt;
 ListenStream=/run/gpsd.sock&lt;br /&gt;
 #ListenStream=[::1]:2947&lt;br /&gt;
 ListenStream=127.0.0.1:2947&lt;br /&gt;
 # To allow gpsd remote access, start gpsd with the -G option and&lt;br /&gt;
 # uncomment the next two lines:&lt;br /&gt;
 #ListenStream=[::]:2947&lt;br /&gt;
 #ListenStream=0.0.0.0:2947&lt;br /&gt;
 SocketMode=0600&lt;br /&gt;
 #BindIPv6Only=yes&lt;br /&gt;
 #BindIPv6Only=both&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
Then I could do&lt;br /&gt;
 systemctl start gpsd&lt;br /&gt;
and verify with&lt;br /&gt;
 cgps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
&lt;br /&gt;
see: https://kickstartembedded.com/2022/07/23/a-beginners-guide-to-using-gpsd-in-linux/&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8763</id>
		<title>Ricbot hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8763"/>
		<updated>2026-04-25T16:07:54Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* On-Off */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hardware == &lt;br /&gt;
&lt;br /&gt;
Tentative layout:&lt;br /&gt;
&lt;br /&gt;
[[file: ricbot_on-shape.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Length is 1m, free height 25cm, width 65cm.&lt;br /&gt;
&lt;br /&gt;
== Installation notes ==&lt;br /&gt;
&lt;br /&gt;
=== Camera position ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric-camera-position.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Forward-looking camera: Intel RealSense D455, FOV 87 x 58 deg, range 0.6 to 6m.&lt;br /&gt;
&lt;br /&gt;
Down-looking camera: Intel RealSense D435, FOV: 87 x 58 deg, range 0.3 to 3m.&lt;br /&gt;
&lt;br /&gt;
=== Cabling ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric_cabling.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
DRI0042: https://wiki.dfrobot.com/15A_Single_DC_Motor_Driver_SKU__DRI0042&lt;br /&gt;
&lt;br /&gt;
[[file: ric-hw-interface-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Interface board (Regbor 6.3) ===&lt;br /&gt;
&lt;br /&gt;
Regbot 6.3: [[Regbot hardware board]]&lt;br /&gt;
&lt;br /&gt;
[[file: ric-regbot-6.3-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* a) Power management split into 3 cables&lt;br /&gt;
** 1) To j17: (b1, r1, h1, y1) on power distribution board&lt;br /&gt;
** 2) To j11: (r2, h2, y2) on power management board (temp sensors)&lt;br /&gt;
** 3) To on/off switch&lt;br /&gt;
* b) Motor driver PWM and direction, 3 pins&lt;br /&gt;
* c) Encoder (optical) 4 pins on original 6-pin motor connector.&lt;br /&gt;
* d) IMU (I2C connection)&lt;br /&gt;
* e) Serial (LED-band) Rx8, TX8 (not working with LED-band (not DMA?))&lt;br /&gt;
&lt;br /&gt;
==== DRI0042 to Regbot 4-pin PWM ====&lt;br /&gt;
&lt;br /&gt;
 DRI              Regbot PWM    Software&lt;br /&gt;
 7 GND   (black)  1 GND         --&lt;br /&gt;
 4 PWM   (red)    2 in1         PIN_xxxx_DIR&lt;br /&gt;
 5 IN1   (white)  3 in2         PIN_xxxx_PWM&lt;br /&gt;
 6 IN2   (yellow) 4 fault       PIN_xxxx_FAULT&lt;br /&gt;
 3 5V out &lt;br /&gt;
&lt;br /&gt;
 DRI0042 control values&lt;br /&gt;
 IN1 	IN2 	PWM 	OUT1, OUT2 Motor Behavior&lt;br /&gt;
 0 	0 	x 	Stop&lt;br /&gt;
 1 	1 	x 	Vacant (relax)&lt;br /&gt;
 1 	0 	1 	Forward 100%&lt;br /&gt;
 0 	1 	1 	Reverse 100%&lt;br /&gt;
 1 	0 	PWM 	Forward at PWM speed&lt;br /&gt;
 0 	1 	PWM 	Reverse at PWM speed&lt;br /&gt;
&lt;br /&gt;
=== Power distribution ===&lt;br /&gt;
&lt;br /&gt;
[[RICBOT Power on-off board]] PCB&lt;br /&gt;
&lt;br /&gt;
[[file: ric-power-distribute-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
==== Power management ====&lt;br /&gt;
 Pin        IDC10-pin      Software       Function&lt;br /&gt;
 1 (black)  1              --             GND&lt;br /&gt;
 2 (red)    3              LS_1  (pin 27) power off (when low)  -- pt not working (wrong mod on power board)&lt;br /&gt;
 3 (white)  4              LS_0  (A6)     battery voltage  (39k/4.7k)&lt;br /&gt;
 4 (yellow) 6              LS_4  (pin 26) Alive LED&lt;br /&gt;
&lt;br /&gt;
==== Temperature ====&lt;br /&gt;
&lt;br /&gt;
 Pin         IDC10          Software       Function&lt;br /&gt;
 1 black     (nc)           --             --&lt;br /&gt;
 2 (red)     7              LS_4 (A8)      Temp on board (not mounted)&lt;br /&gt;
 3 (white)   8              LS_5 (A11)     Temp power distribute (T1)&lt;br /&gt;
 4 (yellow)  9              LS_6 (A9)      Temp motor driver Left&lt;br /&gt;
&lt;br /&gt;
==== On-Off ====&lt;br /&gt;
&lt;br /&gt;
Power on is the mechanical on switch; connect the pins to ON.&lt;br /&gt;
&lt;br /&gt;
Power off is via the Teensy and the other set of contacts of the on-switch. This set goes to IDC-pin 5 and 10. When this set is not connected, the Teensy will set the power management pin to low (power off). It then takes about 10 seconds to turn off.&lt;br /&gt;
&lt;br /&gt;
==== Encoder ====&lt;br /&gt;
&lt;br /&gt;
The encoder connection connects one type of plug (5 pins) from the encoder to another (4 pins) on the HW-interface board.&lt;br /&gt;
&lt;br /&gt;
==== Temperature sensors ====&lt;br /&gt;
&lt;br /&gt;
The on-board temperature sensor is not mounted.&lt;br /&gt;
The others are of type MCP9700A, extended with a cable to the 3-pin plug.&lt;br /&gt;
&lt;br /&gt;
=== Teensy interface ===&lt;br /&gt;
&lt;br /&gt;
The Teensy interface implements a bridge to MQTT, a motor controller (velocity and turn rate), and a remote control.&lt;br /&gt;
&lt;br /&gt;
The configuration is in&lt;br /&gt;
 /home/local/svn/teensy_interface/build/robot.ini&lt;br /&gt;
&lt;br /&gt;
See also [[Robobot teensy interface]].&lt;br /&gt;
&lt;br /&gt;
=== Start at boot ===&lt;br /&gt;
&lt;br /&gt;
See the similar start setup in [[https://rsewiki.electro.dtu.dk/index.php?title=Enable_autostart#Autostart]].&lt;br /&gt;
&lt;br /&gt;
Comment out (or delete) the start of the camera streamer (not compatible with RealSense 3D cam)&lt;br /&gt;
&lt;br /&gt;
=== Install software on Raspberry Pi ===&lt;br /&gt;
&lt;br /&gt;
Perform the same installation as [[Robobot install on Raspberry]], except for the serial port configuration (which should not be needed).&lt;br /&gt;
&lt;br /&gt;
=== Teensy software ===&lt;br /&gt;
&lt;br /&gt;
This is the Regbot software, configured to match the Ricbot.&lt;br /&gt;
&lt;br /&gt;
See more details here [[Regbot firmware]].&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8762</id>
		<title>Ricbot hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8762"/>
		<updated>2026-04-25T16:03:18Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Power distribution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hardware == &lt;br /&gt;
&lt;br /&gt;
Tentative layout:&lt;br /&gt;
&lt;br /&gt;
[[file: ricbot_on-shape.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Length is 1m, free height 25cm, width 65cm.&lt;br /&gt;
&lt;br /&gt;
== Installation notes ==&lt;br /&gt;
&lt;br /&gt;
=== Camera position ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric-camera-position.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Forward-looking camera: Intel RealSense D455, FOV 87 x 58 deg, range 0.6 to 6m.&lt;br /&gt;
&lt;br /&gt;
Down-looking camera: Intel RealSense D435, FOV: 87 x 58 deg, range 0.3 to 3m.&lt;br /&gt;
&lt;br /&gt;
=== Cabling ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric_cabling.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
DRI0042: https://wiki.dfrobot.com/15A_Single_DC_Motor_Driver_SKU__DRI0042&lt;br /&gt;
&lt;br /&gt;
[[file: ric-hw-interface-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Interface board (Regbor 6.3) ===&lt;br /&gt;
&lt;br /&gt;
Regbot 6.3: [[Regbot hardware board]]&lt;br /&gt;
&lt;br /&gt;
[[file: ric-regbot-6.3-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* a) Power management split into 3 cables&lt;br /&gt;
** 1) To j17: (b1, r1, h1, y1) on power distribution board&lt;br /&gt;
** 2) To j11: (r2, h2, y2) on power management board (temp sensors)&lt;br /&gt;
** 3) To on/off switch&lt;br /&gt;
* b) Motor driver PWM and direction, 3 pins&lt;br /&gt;
* c) Encoder (optical) 4 pins on original 6-pin motor connector.&lt;br /&gt;
* d) IMU (I2C connection)&lt;br /&gt;
* e) Serial (LED-band) Rx8, TX8 (not working with LED-band (not DMA?))&lt;br /&gt;
&lt;br /&gt;
==== DRI0042 to Regbot 4-pin PWM ====&lt;br /&gt;
&lt;br /&gt;
 DRI              Regbot PWM    Software&lt;br /&gt;
 7 GND   (black)  1 GND         --&lt;br /&gt;
 4 PWM   (red)    2 in1         PIN_xxxx_DIR&lt;br /&gt;
 5 IN1   (white)  3 in2         PIN_xxxx_PWM&lt;br /&gt;
 6 IN2   (yellow) 4 fault       PIN_xxxx_FAULT&lt;br /&gt;
 3 5V out &lt;br /&gt;
&lt;br /&gt;
 DRI0042 control values&lt;br /&gt;
 IN1 	IN2 	PWM 	OUT1, OUT2 Motor Behavior&lt;br /&gt;
 0 	0 	x 	Stop&lt;br /&gt;
 1 	1 	x 	Vacant (relax)&lt;br /&gt;
 1 	0 	1 	Forward 100%&lt;br /&gt;
 0 	1 	1 	Reverse 100%&lt;br /&gt;
 1 	0 	PWM 	Forward at PWM speed&lt;br /&gt;
 0 	1 	PWM 	Reverse at PWM speed&lt;br /&gt;
&lt;br /&gt;
=== Power distribution ===&lt;br /&gt;
&lt;br /&gt;
[[RICBOT Power on-off board]] PCB&lt;br /&gt;
&lt;br /&gt;
[[file: ric-power-distribute-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
==== Power management ====&lt;br /&gt;
 Pin        IDC10-pin      Software       Function&lt;br /&gt;
 1 (black)  1              --             GND&lt;br /&gt;
 2 (red)    3              LS_1  (pin 27) power off (when low)  -- pt not working (wrong mod on power board)&lt;br /&gt;
 3 (white)  4              LS_0  (A6)     battery voltage  (39k/4.7k)&lt;br /&gt;
 4 (yellow) 6              LS_4  (pin 26) Alive LED&lt;br /&gt;
&lt;br /&gt;
==== Temperature ====&lt;br /&gt;
&lt;br /&gt;
 Pin         IDC10          Software       Function&lt;br /&gt;
 1 black     (nc)           --             --&lt;br /&gt;
 2 (red)     7              LS_4 (A8)      Temp on board (not mounted)&lt;br /&gt;
 3 (white)   8              LS_5 (A11)     Temp power distribute (T1)&lt;br /&gt;
 4 (yellow)  9              LS_6 (A9)      Temp motor driver Left&lt;br /&gt;
&lt;br /&gt;
==== On-Off ====&lt;br /&gt;
&lt;br /&gt;
Power on is the mechanical on switch; connect the pins to ON.&lt;br /&gt;
&lt;br /&gt;
Power off is via the Teensy and the other set of contacts of the on-switch. This set goes to IDC-pin 5 and 10. When this set is not connected, the Teensy will set the power management pin to low (power off). It then takes about 10 seconds to turn off.&lt;br /&gt;
&lt;br /&gt;
=== Teensy interface ===&lt;br /&gt;
&lt;br /&gt;
The Teensy interface implements a bridge to MQTT, a motor controller (velocity and turn rate), and a remote control.&lt;br /&gt;
&lt;br /&gt;
The configuration is in&lt;br /&gt;
 /home/local/svn/teensy_interface/build/robot.ini&lt;br /&gt;
&lt;br /&gt;
See also [[Robobot teensy interface]].&lt;br /&gt;
&lt;br /&gt;
=== Start at boot ===&lt;br /&gt;
&lt;br /&gt;
See the similar start setup in [[https://rsewiki.electro.dtu.dk/index.php?title=Enable_autostart#Autostart]].&lt;br /&gt;
&lt;br /&gt;
Comment out (or delete) the start of the camera streamer (not compatible with RealSense 3D cam)&lt;br /&gt;
&lt;br /&gt;
=== Install software on Raspberry Pi ===&lt;br /&gt;
&lt;br /&gt;
Perform the same installation as [[Robobot install on Raspberry]], except for the serial port configuration (which should not be needed).&lt;br /&gt;
&lt;br /&gt;
=== Teensy software ===&lt;br /&gt;
&lt;br /&gt;
This is the Regbot software, configured to match the Ricbot.&lt;br /&gt;
&lt;br /&gt;
See more details here [[Regbot firmware]].&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8761</id>
		<title>Ricbot hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8761"/>
		<updated>2026-04-25T15:56:54Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Power distribution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hardware == &lt;br /&gt;
&lt;br /&gt;
Tentative layout:&lt;br /&gt;
&lt;br /&gt;
[[file: ricbot_on-shape.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Length is 1m, free height 25cm, width 65cm.&lt;br /&gt;
&lt;br /&gt;
== Installation notes ==&lt;br /&gt;
&lt;br /&gt;
=== Camera position ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric-camera-position.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Forward-looking camera: Intel RealSense D455, FOV 87 x 58 deg, range 0.6 to 6m.&lt;br /&gt;
&lt;br /&gt;
Down-looking camera: Intel RealSense D435, FOV: 87 x 58 deg, range 0.3 to 3m.&lt;br /&gt;
&lt;br /&gt;
=== Cabling ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric_cabling.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
DRI0042: https://wiki.dfrobot.com/15A_Single_DC_Motor_Driver_SKU__DRI0042&lt;br /&gt;
&lt;br /&gt;
[[file: ric-hw-interface-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Interface board (Regbor 6.3) ===&lt;br /&gt;
&lt;br /&gt;
Regbot 6.3: [[Regbot hardware board]]&lt;br /&gt;
&lt;br /&gt;
[[file: ric-regbot-6.3-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* a) Power management split into 3 cables&lt;br /&gt;
** 1) To j17: (b1, r1, h1, y1) on power distribution board&lt;br /&gt;
** 2) To j11: (r2, h2, y2) on power management board (temp sensors)&lt;br /&gt;
** 3) To on/off switch&lt;br /&gt;
* b) Motor driver PWM and direction, 3 pins&lt;br /&gt;
* c) Encoder (optical) 4 pins on original 6-pin motor connector.&lt;br /&gt;
* d) IMU (I2C connection)&lt;br /&gt;
* e) Serial (LED-band) Rx8, TX8 (not working with LED-band (not DMA?))&lt;br /&gt;
&lt;br /&gt;
==== DRI0042 to Regbot 4-pin PWM ====&lt;br /&gt;
&lt;br /&gt;
 DRI              Regbot PWM    Software&lt;br /&gt;
 7 GND   (black)  1 GND         --&lt;br /&gt;
 4 PWM   (red)    2 in1         PIN_xxxx_DIR&lt;br /&gt;
 5 IN1   (white)  3 in2         PIN_xxxx_PWM&lt;br /&gt;
 6 IN2   (yellow) 4 fault       PIN_xxxx_FAULT&lt;br /&gt;
 3 5V out &lt;br /&gt;
&lt;br /&gt;
 DRI0042 control values&lt;br /&gt;
 IN1 	IN2 	PWM 	OUT1, OUT2 Motor Behavior&lt;br /&gt;
 0 	0 	x 	Stop&lt;br /&gt;
 1 	1 	x 	Vacant (relax)&lt;br /&gt;
 1 	0 	1 	Forward 100%&lt;br /&gt;
 0 	1 	1 	Reverse 100%&lt;br /&gt;
 1 	0 	PWM 	Forward at PWM speed&lt;br /&gt;
 0 	1 	PWM 	Reverse at PWM speed&lt;br /&gt;
&lt;br /&gt;
=== Power distribution ===&lt;br /&gt;
&lt;br /&gt;
[[RICBOT Power on-off board]] PCB&lt;br /&gt;
&lt;br /&gt;
[[file: ric-power-distribute-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
==== Power management ====&lt;br /&gt;
 Pin        IDC10-pin      Software       Function&lt;br /&gt;
 1 (black)  1              --             GND&lt;br /&gt;
 2 (red)    3              LS_1  (pin 27) power off (when low)  -- pt not working (wrong mod on power board)&lt;br /&gt;
 3 (white)  4              LS_0  (A6)     battery voltage  (39k/4.7k)&lt;br /&gt;
 4 (yellow) 6              LS_4  (pin 26) Alive LED&lt;br /&gt;
&lt;br /&gt;
==== Temperature ====&lt;br /&gt;
&lt;br /&gt;
 Pin         IDC10          Software       Function&lt;br /&gt;
 1 black     (nc)           --             --&lt;br /&gt;
 2 (red)     7              LS_4 (A8)      Temp on board (not mounted)&lt;br /&gt;
 3 (white)   8              LS_5 (A11)     Temp power distribute (T1)&lt;br /&gt;
 4 (yellow)  9              LS_6 (A9)      Temp motor driver Left&lt;br /&gt;
&lt;br /&gt;
=== Teensy interface ===&lt;br /&gt;
&lt;br /&gt;
The Teensy interface implements a bridge to MQTT, a motor controller (velocity and turn rate), and a remote control.&lt;br /&gt;
&lt;br /&gt;
The configuration is in&lt;br /&gt;
 /home/local/svn/teensy_interface/build/robot.ini&lt;br /&gt;
&lt;br /&gt;
See also [[Robobot teensy interface]].&lt;br /&gt;
&lt;br /&gt;
=== Start at boot ===&lt;br /&gt;
&lt;br /&gt;
See the similar start setup in [[https://rsewiki.electro.dtu.dk/index.php?title=Enable_autostart#Autostart]].&lt;br /&gt;
&lt;br /&gt;
Comment out (or delete) the start of the camera streamer (not compatible with RealSense 3D cam)&lt;br /&gt;
&lt;br /&gt;
=== Install software on Raspberry Pi ===&lt;br /&gt;
&lt;br /&gt;
Perform the same installation as [[Robobot install on Raspberry]], except for the serial port configuration (which should not be needed).&lt;br /&gt;
&lt;br /&gt;
=== Teensy software ===&lt;br /&gt;
&lt;br /&gt;
This is the Regbot software, configured to match the Ricbot.&lt;br /&gt;
&lt;br /&gt;
See more details here [[Regbot firmware]].&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-power-distribute-ann.png&amp;diff=8760</id>
		<title>File:Ric-power-distribute-ann.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-power-distribute-ann.png&amp;diff=8760"/>
		<updated>2026-04-25T15:20:36Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-regbot-6.3-ann.png&amp;diff=8759</id>
		<title>File:Ric-regbot-6.3-ann.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-regbot-6.3-ann.png&amp;diff=8759"/>
		<updated>2026-04-25T15:20:13Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-hw-interface-ann.png&amp;diff=8758</id>
		<title>File:Ric-hw-interface-ann.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Ric-hw-interface-ann.png&amp;diff=8758"/>
		<updated>2026-04-25T15:19:49Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8757</id>
		<title>Ricbot hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_hardware&amp;diff=8757"/>
		<updated>2026-04-25T15:15:02Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Cabling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hardware == &lt;br /&gt;
&lt;br /&gt;
Tentative layout:&lt;br /&gt;
&lt;br /&gt;
[[file: ricbot_on-shape.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Length is 1m, free height 25cm, width 65cm.&lt;br /&gt;
&lt;br /&gt;
== Installation notes ==&lt;br /&gt;
&lt;br /&gt;
=== Camera position ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric-camera-position.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Forward-looking camera: Intel RealSense D455, FOV 87 x 58 deg, range 0.6 to 6m.&lt;br /&gt;
&lt;br /&gt;
Down-looking camera: Intel RealSense D435, FOV: 87 x 58 deg, range 0.3 to 3m.&lt;br /&gt;
&lt;br /&gt;
=== Cabling ===&lt;br /&gt;
&lt;br /&gt;
[[file: ric_cabling.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
DRI0042: https://wiki.dfrobot.com/15A_Single_DC_Motor_Driver_SKU__DRI0042&lt;br /&gt;
&lt;br /&gt;
[[file: ric-hw-interface-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Interface board (Regbor 6.3) ===&lt;br /&gt;
&lt;br /&gt;
Regbot 6.3: [[Regbot hardware board]]&lt;br /&gt;
&lt;br /&gt;
[[file: ric-regbot-6.3-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* a) Power management split into 3 cables&lt;br /&gt;
** 1) To j17: (b1, r1, h1, y1) on power distribution board&lt;br /&gt;
** 2) To j11: (r2, h2, y2) on power management board (temp sensors)&lt;br /&gt;
** 3) To on/off switch&lt;br /&gt;
* b) Motor driver PWM and direction, 3 pins&lt;br /&gt;
* c) Encoder (optical) 4 pins on original 6-pin motor connector.&lt;br /&gt;
* d) IMU (I2C connection)&lt;br /&gt;
* e) Serial (LED-band) Rx8, TX8 (not working with LED-band (not DMA?))&lt;br /&gt;
&lt;br /&gt;
==== DRI0042 to Regbot 4-pin PWM ====&lt;br /&gt;
&lt;br /&gt;
 DRI              Regbot PWM    Software&lt;br /&gt;
 7 GND   (black)  1 GND         --&lt;br /&gt;
 4 PWM   (red)    2 in1         PIN_xxxx_DIR&lt;br /&gt;
 5 IN1   (white)  3 in2         PIN_xxxx_PWM&lt;br /&gt;
 6 IN2   (yellow) 4 fault       PIN_xxxx_FAULT&lt;br /&gt;
 3 5V out &lt;br /&gt;
&lt;br /&gt;
 DRI0042 control values&lt;br /&gt;
 IN1 	IN2 	PWM 	OUT1, OUT2 Motor Behavior&lt;br /&gt;
 0 	0 	x 	Stop&lt;br /&gt;
 1 	1 	x 	Vacant (relax)&lt;br /&gt;
 1 	0 	1 	Forward 100%&lt;br /&gt;
 0 	1 	1 	Reverse 100%&lt;br /&gt;
 1 	0 	PWM 	Forward at PWM speed&lt;br /&gt;
 0 	1 	PWM 	Reverse at PWM speed&lt;br /&gt;
&lt;br /&gt;
=== Power distribution ===&lt;br /&gt;
&lt;br /&gt;
[[RICBOT Power on-off board]] PCB&lt;br /&gt;
&lt;br /&gt;
[[file: ric-power-distribute-ann.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
 Pin        IDC10-pin      Software       Function&lt;br /&gt;
 1 (black)  1              --             GND&lt;br /&gt;
 2 (red)    3              LS_1  (pin 27) power off (when low)  -- pt not working (wrong mod on power board)&lt;br /&gt;
 3 (white)  4              LS_0  (A6)     battery voltage  (39k/4.7k)&lt;br /&gt;
 4 (yellow) 6              LS_4  (pin 26) Alive LED&lt;br /&gt;
&lt;br /&gt;
=== Teensy interface ===&lt;br /&gt;
&lt;br /&gt;
The Teensy interface implements a bridge to MQTT, a motor controller (velocity and turn rate), and a remote control.&lt;br /&gt;
&lt;br /&gt;
The configuration is in&lt;br /&gt;
 /home/local/svn/teensy_interface/build/robot.ini&lt;br /&gt;
&lt;br /&gt;
See also [[Robobot teensy interface]].&lt;br /&gt;
&lt;br /&gt;
=== Start at boot ===&lt;br /&gt;
&lt;br /&gt;
See the similar start setup in [[https://rsewiki.electro.dtu.dk/index.php?title=Enable_autostart#Autostart]].&lt;br /&gt;
&lt;br /&gt;
Comment out (or delete) the start of the camera streamer (not compatible with RealSense 3D cam)&lt;br /&gt;
&lt;br /&gt;
=== Install software on Raspberry Pi ===&lt;br /&gt;
&lt;br /&gt;
Perform the same installation as [[Robobot install on Raspberry]], except for the serial port configuration (which should not be needed).&lt;br /&gt;
&lt;br /&gt;
=== Teensy software ===&lt;br /&gt;
&lt;br /&gt;
This is the Regbot software, configured to match the Ricbot.&lt;br /&gt;
&lt;br /&gt;
See more details here [[Regbot firmware]].&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8756</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8756"/>
		<updated>2026-04-21T09:08:04Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Decode and publish */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
Support added to teensy_interface (not fully tested) - part of Robobot software.&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
(not implemented yet)&lt;br /&gt;
&lt;br /&gt;
see: https://kickstartembedded.com/2022/07/23/a-beginners-guide-to-using-gpsd-in-linux/&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8755</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8755"/>
		<updated>2026-04-21T09:07:30Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* GNSS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
Support added to teensy_interface (not fully tested) - part of Robobot software.&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
(not implemented yet)&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8754</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8754"/>
		<updated>2026-04-21T09:05:41Z</updated>

		<summary type="html">&lt;p&gt;Jca: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Additional installation&lt;br /&gt;
&lt;br /&gt;
 sudo apt install gpsd gpsd-clients libgps-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
(not implemented yet)&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8753</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8753"/>
		<updated>2026-04-20T12:34:22Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* NTP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli dev wifi&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
=== PTP ===&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
=== NTP (depricated) ===&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8752</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8752"/>
		<updated>2026-04-20T12:33:39Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* PTP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli dev wifi&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8751</id>
		<title>Network setup</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Network_setup&amp;diff=8751"/>
		<updated>2026-04-20T12:33:05Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* NTP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Robobot B]]&lt;br /&gt;
&lt;br /&gt;
==WiFi network==&lt;br /&gt;
&lt;br /&gt;
If you are at DTU and the small display shows an IP, then all is fine. Otherwise read further down.&lt;br /&gt;
&lt;br /&gt;
====Network Manager====&lt;br /&gt;
&lt;br /&gt;
The NetworkManager uses device UUID as part of the Wi-Fi network setup. This means that (sometimes) an SD card can not be moved from one robot to another with a functional Wi-Fi connection.&lt;br /&gt;
&lt;br /&gt;
After 20 seconds, an attempt to solve this is activated using the commands below (the code is found in svn/robobot/setup/rename_host.bash - last half).&lt;br /&gt;
&lt;br /&gt;
Use the last line to setup manually - or the GUI, if available.&lt;br /&gt;
&lt;br /&gt;
See the current network settings&lt;br /&gt;
 nmcli dev show&lt;br /&gt;
Network manager connection with UUID&lt;br /&gt;
 nmcli connection&lt;br /&gt;
List available wifi access points&lt;br /&gt;
 nmcli dev wifi&lt;br /&gt;
&lt;br /&gt;
==== Connect to DTUdevice net ====&lt;br /&gt;
&lt;br /&gt;
You can establish a new connection from the command line&lt;br /&gt;
 sudo nmcli device wifi connect DTUdevice password &amp;lt;password&amp;gt; ifname wlan0 ipv6.method &amp;quot;disabled&amp;quot;&lt;br /&gt;
This should create a new system-connection file with a usable UUID.&lt;br /&gt;
IPv6 is disabled because many of the IPv6 MACs appear to be the same (we cloned the SD card), and this will blacklist the connection for MAC address theft.&lt;br /&gt;
&lt;br /&gt;
There is a terminal-based user interface to edit a connection. First list connections:&lt;br /&gt;
 $ nmcli con show&lt;br /&gt;
 eg: NAME            UUID                                  TYPE      DEVICE &lt;br /&gt;
 preconfigured       e07a0ae8-028b-4d65-806c-ec63f435df44  wifi      wlan0  &lt;br /&gt;
 lo                  2737bad6-956f-4668-99e0-4697f4ec30a7  loopback  lo &lt;br /&gt;
Find the NAME of the connection to edit, e.g. &#039;preconfigured&#039;&lt;br /&gt;
 sudo nmtui edit &amp;quot;preconfigured&amp;quot;&lt;br /&gt;
Then edit as desired.&lt;br /&gt;
&lt;br /&gt;
Reload Network Manager to read this.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
or restart the NetworkManager&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
==== Home network connection ====&lt;br /&gt;
&lt;br /&gt;
If you know the SSID and password, you can prepare the robot for another (home) network.&lt;br /&gt;
Use this command (replacing &amp;lt;SSID&amp;gt; and &amp;lt;password&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli device wifi connect &amp;lt;SSID&amp;gt; password &amp;lt;password&amp;gt; ifname wlan0&lt;br /&gt;
&lt;br /&gt;
If you have no network contact, then use a local link (cable) or attach a screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Cable connection ==&lt;br /&gt;
&lt;br /&gt;
==== Using static IP and DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
Assign a static IP for the Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add con-name eth0-manual ifname eth0 type ethernet ip4 192.168.7.7/24 ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
The Raspberry&#039;s IP address is 192.168.7.7 when a cable is connected. The Network Manager may need to be reloaded.&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con reload&lt;br /&gt;
&lt;br /&gt;
Your PC on the other end then needs to be assigned a static (manual) IP address in the same network, e.g., 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
The response time on the cable is much faster than over wifi. Typically less than 0.5ms on cable and often more than 5ms on wifi. Try ping from your PC:&lt;br /&gt;
&lt;br /&gt;
 ping 192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
&lt;br /&gt;
I found this method (Google AI) to use DHCP with higher priority, and then static IP if DHCP fails&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Wired-DHCP&amp;quot; ifname eth0 ipv4.method auto autoconnect yes connect.autoconnect-priority 1&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection add type ethernet con-name &amp;quot;Robobot-Static7&amp;quot; ifname eth0 ipv4.method manual ipv4.addresses 192.168.7.7/24 ipv4.gateway 192.168.7.1 ipv4.dns 8.8.8.8 autoconnect yes connect.autoconnect-priority 0&lt;br /&gt;
&lt;br /&gt;
This creates 2 entries in /etc/NetworkManager/system-connections (on a default Raspberry Pi 64 Bit OS using Network Manager)&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Wired-DHCP.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Wired-DHCP&lt;br /&gt;
 uuid=339844b1-cee4-4a43-a3f1-a5de05f3cb70&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 autoconnect-priority=1&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet]&lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note! the UUID should be different&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
/etc/NetworkManager/system-connections/Robobot-Static7.nmconnection&lt;br /&gt;
&lt;br /&gt;
 [connection]&lt;br /&gt;
 id=Robobot-Static7&lt;br /&gt;
 uuid=2a91ef05-3666-4293-a793-330c3b49cdd4&lt;br /&gt;
 type=ethernet&lt;br /&gt;
 interface-name=eth0&lt;br /&gt;
 &lt;br /&gt;
 [ethernet] &lt;br /&gt;
 &lt;br /&gt;
 [ipv4]&lt;br /&gt;
 address1=192.168.7.7/24,192.168.7.1&lt;br /&gt;
 dns=8.8.8.8;&lt;br /&gt;
 method=manual&lt;br /&gt;
 &lt;br /&gt;
 [ipv6]&lt;br /&gt;
 addr-gen-mode=default&lt;br /&gt;
 method=auto&lt;br /&gt;
 &lt;br /&gt;
 [proxy]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note2! To default to static IP can take 2-4 minutes after detecting the cable! (at least 2 times 60 second timeout is needed)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On your laptop you can do the same, but probably more efficient, set to manual IP v4.&lt;br /&gt;
This can be done using your GUI tools, or on Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo ip eth0 192.168.7.22&lt;br /&gt;
&lt;br /&gt;
Note! &#039;&#039;eth0&#039;&#039; may be different, as modern hardware often has a more complex name, as &#039;&#039;eno1&#039;&#039; or &#039;&#039;enp108s0&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note2! If the robot has 192.168.7.7, then you should use something else for your laptop, e.g. 192.168.7.22.&lt;br /&gt;
&lt;br /&gt;
Then ssh to the robot&lt;br /&gt;
&lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Install DNS server on Raspberry ====&lt;br /&gt;
&lt;br /&gt;
This section may be deprecated, use the alternative method above with fallback to static IP.&lt;br /&gt;
&lt;br /&gt;
Allow the connected PC to get an IP automatically; install DNSMASQ&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dnsmasq&lt;br /&gt;
&lt;br /&gt;
Configure the use by editing /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
&lt;br /&gt;
Uncomment and change two lines. It is to be used on ETH0 only and in the IP range 192.168.7.50 to 192.168.7.99.&lt;br /&gt;
&lt;br /&gt;
 # DNS requests only on&lt;br /&gt;
 # specified interface&lt;br /&gt;
 interface=eth0&lt;br /&gt;
 # range of addresses available for lease and optionally&lt;br /&gt;
 # a lease time&lt;br /&gt;
 dhcp-range=192.168.7.50,192.168.7.99,255.255.255.0,12h&lt;br /&gt;
&lt;br /&gt;
Restart the dnsmasq&lt;br /&gt;
&lt;br /&gt;
 sudo service dnsmasq restart&lt;br /&gt;
&lt;br /&gt;
To see the status of the dnsmasq service use:&lt;br /&gt;
&lt;br /&gt;
 journalctl -b0 -u dnsmasq.service&lt;br /&gt;
&lt;br /&gt;
After this, when you plug in a cable to a PC, then, after some seconds, both the robot and the PC should have an IP in the range 192.168.7.x. And the robot should display the new IP 192.168.7.7.&lt;br /&gt;
&lt;br /&gt;
You can now access the robot using &lt;br /&gt;
 ssh local@192.168.7.7&lt;br /&gt;
&lt;br /&gt;
==== Local link ====&lt;br /&gt;
&lt;br /&gt;
Note: This method failed in most cases&lt;br /&gt;
&lt;br /&gt;
If wifi is too slow or unavailable, a local link using a network cable could be the solution.&lt;br /&gt;
&lt;br /&gt;
Many PCs will assign a local link IP like 168.254.x.x, and the Robot will do the same. The robot IP will be displayed on the small display but may be obscured if a Wi-Fi IP is available.&lt;br /&gt;
&lt;br /&gt;
To prepare this behaviour, log in to the Raspberry using wifi (or attach a screen and keyboard) and make a preferred local-link cabled connection:&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli con mod &amp;quot;Wired connection 1&amp;quot; ipv4.method link-local ipv6.method disabled&lt;br /&gt;
&lt;br /&gt;
This should then be the behaviour after a reboot. &amp;quot;Wired connection 1&amp;quot; needs to be spelt this way; see the valid names using:&lt;br /&gt;
&lt;br /&gt;
 nmcli connection&lt;br /&gt;
&lt;br /&gt;
Reload Network manager&lt;br /&gt;
&lt;br /&gt;
 sudo nmcli connection reload&lt;br /&gt;
&lt;br /&gt;
== Check IP and SSID ==&lt;br /&gt;
&lt;br /&gt;
When the Pi has rebooted, connect to it using SSH once again. Check that the Pi is connected to WiFi&lt;br /&gt;
 ifconfig&lt;br /&gt;
Under &#039;&#039;&#039;wlan0&#039;&#039;&#039; confirm that the Pi has received an IP (inet addr) and note down the first three sections of the IP - they are most likely &#039;&#039;&#039;10.197.21x.xxx&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see which SSID you are connected to, use&lt;br /&gt;
 iwconfig&lt;br /&gt;
or &lt;br /&gt;
 nmcli -o&lt;br /&gt;
&lt;br /&gt;
The MAC address (&#039;HWaddr&#039; or &#039;ether&#039;) of the Pi should also be noted down - this probably starts with &#039;&#039;&#039;B8:27:EB:xx:xx:xx&#039;&#039;&#039; make sure to get all of it.&lt;br /&gt;
&lt;br /&gt;
===Find IP of robot (Linux)===&lt;br /&gt;
&lt;br /&gt;
In case the Pi gets a new IP address after reboot, you can search for it using the MAC address and &#039;&#039;&#039;nmap&#039;&#039;&#039;. If &#039;&#039;&#039;nmap&#039;&#039;&#039; is not installed, start by installing it&lt;br /&gt;
 sudo apt-get install nmap&lt;br /&gt;
To search for the Pi using the MAC address in terminal type&lt;br /&gt;
 nmap -sP 10.197.218.0/20 | awk &#039;/^Nmap/{ip=$NF}/B8:27:EB:23:A0:F5/{print ip}&#039;&lt;br /&gt;
where &#039;&#039;&#039;10.197.218&#039;&#039;&#039; is the first three sections of the IP you noted down, 20 is the number of fixed bits (out of 32), and &#039;&#039;&#039;B8:27:EB:23:A0:F5&#039;&#039;&#039; is the MAC address of the Pi. This should return the IP of the Pi.&lt;br /&gt;
&lt;br /&gt;
NB! the MAC can hold letters, they should probably be capital.&lt;br /&gt;
&lt;br /&gt;
==== If you don&#039;t know the IP address====&lt;br /&gt;
&lt;br /&gt;
Use the first part to get a list of active IPs on the net:&lt;br /&gt;
  nmap -sP 10.197.218.0/24&lt;br /&gt;
&lt;br /&gt;
The robot&#039;s name should be included in the list, but the network may take a while to detect it.&lt;br /&gt;
&lt;br /&gt;
== PTP ==&lt;br /&gt;
&lt;br /&gt;
Precise Time Protocol (on Raspberry Pi 5)&lt;br /&gt;
&lt;br /&gt;
Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.&lt;br /&gt;
&lt;br /&gt;
==== Install ====&lt;br /&gt;
&lt;br /&gt;
Install on both master and slave:&lt;br /&gt;
 sudo apt install linuxptp&lt;br /&gt;
&lt;br /&gt;
Verify that there is support on &#039;eth0&#039;.&lt;br /&gt;
Should have hardware capabilities:&lt;br /&gt;
&lt;br /&gt;
 $ ethtool -T eth0&lt;br /&gt;
 Time stamping parameters for eth0:&lt;br /&gt;
 Capabilities:&lt;br /&gt;
        hardware-transmit&lt;br /&gt;
        software-transmit&lt;br /&gt;
        hardware-receive&lt;br /&gt;
        software-receive&lt;br /&gt;
        software-system-clock&lt;br /&gt;
        hardware-raw-clock&lt;br /&gt;
&lt;br /&gt;
==== Test time master ====&lt;br /&gt;
&lt;br /&gt;
Start connection to eth0 hardware (as a process in the background)&lt;br /&gt;
&lt;br /&gt;
 sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Start clock master service on eth0&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
It should be activated as a grand master soon.&lt;br /&gt;
&lt;br /&gt;
==== Test time client ====&lt;br /&gt;
&lt;br /&gt;
Run a PTP test slave (-s) with output to console (-m).&lt;br /&gt;
&lt;br /&gt;
sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
After a few minutes, this should yield a time offset on the order of 100 ns.&lt;br /&gt;
&lt;br /&gt;
Kill the phc2sys on the time server after the client test:&lt;br /&gt;
 sudo pkill phc2sys&lt;br /&gt;
&lt;br /&gt;
==== Install as a service on Master ====&lt;br /&gt;
&lt;br /&gt;
Most is copied from https://austinsnerdythings.com/2025/02/18/nanosecond-accurate-ptp-server-grandmaster-and-client-tutorial-for-raspberry-pi/.&lt;br /&gt;
&lt;br /&gt;
Create a service file for the connection to eth0:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/phc2sys-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=sync PHC with system clock (grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -w&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Create a service file for the ptp server:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Enable and start these services&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl enable ptp4l-grandmaster.service&lt;br /&gt;
 sudo systemctl start phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl start ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
==== Install as a service on the client ====&lt;br /&gt;
&lt;br /&gt;
Make a new service file&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-client.service&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Client)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2 -m --summary_interval 3&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Also, enable and start this service:&lt;br /&gt;
&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable ptp4l-client.service&lt;br /&gt;
sudo systemctl start ptp4l-client.service&lt;br /&gt;
&lt;br /&gt;
Check the status of the client when all is in place&lt;br /&gt;
 sudo systemctl status ptp4l-client&lt;br /&gt;
&lt;br /&gt;
== NTP ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Depreciated&#039;&#039;&#039;. The Raspberry default time sync now works, also at DTU.&lt;br /&gt;
&lt;br /&gt;
For PTP, see [[Ricbot PTP]].&lt;br /&gt;
&lt;br /&gt;
Network Time Protocol is used to keep clocks in sync.&lt;br /&gt;
Raspberry Pi will start with the date and time of the last proper shutdown, and a few seconds after the network is up, it will sync the clock using NTP.&lt;br /&gt;
&lt;br /&gt;
NTP need to be installed, i.e. &#039;sudo apt install ntp&#039; if not done already.&lt;br /&gt;
&lt;br /&gt;
At DTU, most clock sources are blocked; the clock source needs to be configured.&lt;br /&gt;
&lt;br /&gt;
At DTU, edit /etc/NTP.conf or /etc/ntpsec/ntp.conf and add ntp.ait.du.dk to the top of the server pool list.&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/ntpsec/ntp.conf&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board&lt;br /&gt;
 # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for&lt;br /&gt;
 # more information.&lt;br /&gt;
 pool ntp.ait.dtu.dk&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Sync time (if on DTU net)&lt;br /&gt;
&lt;br /&gt;
 sudo ntpdate -u ntp.ait.dtu.dk&lt;br /&gt;
&lt;br /&gt;
Should work in and around DTU - see also [[NTP howto]] for more details.&lt;br /&gt;
&lt;br /&gt;
You can also check the status of the ntp service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl status ntp.service&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8750</id>
		<title>Ricbot PTP</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8750"/>
		<updated>2026-04-20T12:30:57Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Install as a service on the client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== PTP ==&lt;br /&gt;
&lt;br /&gt;
Precise Time Protocol (on Raspberry Pi 5)&lt;br /&gt;
&lt;br /&gt;
Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Install on both master and slave:&lt;br /&gt;
 sudo apt install linuxptp&lt;br /&gt;
&lt;br /&gt;
Verify that there is support on &#039;eth0&#039;.&lt;br /&gt;
Should have hardware capabilities:&lt;br /&gt;
&lt;br /&gt;
 $ ethtool -T eth0&lt;br /&gt;
 Time stamping parameters for eth0:&lt;br /&gt;
 Capabilities:&lt;br /&gt;
        hardware-transmit&lt;br /&gt;
        software-transmit&lt;br /&gt;
        hardware-receive&lt;br /&gt;
        software-receive&lt;br /&gt;
        software-system-clock&lt;br /&gt;
        hardware-raw-clock&lt;br /&gt;
&lt;br /&gt;
=== Test time master ===&lt;br /&gt;
&lt;br /&gt;
Start connection to eth0 hardware (as a process in the background)&lt;br /&gt;
&lt;br /&gt;
 sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Start clock master service on eth0&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2&lt;br /&gt;
&lt;br /&gt;
It should be activated as a grand master soon.&lt;br /&gt;
&lt;br /&gt;
=== Test time client ===&lt;br /&gt;
&lt;br /&gt;
Run a PTP test slave (-s) with output to console (-m).&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
After a few minutes, this should yield a time offset on the order of 100 ns.&lt;br /&gt;
&lt;br /&gt;
Kill the phc2sys on the time server after the client test:&lt;br /&gt;
 sudo pkill phc2sys&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on Master ===&lt;br /&gt;
&lt;br /&gt;
Most is copied from https://austinsnerdythings.com/2025/02/18/nanosecond-accurate-ptp-server-grandmaster-and-client-tutorial-for-raspberry-pi/.&lt;br /&gt;
&lt;br /&gt;
Create a service file for the connection to eth0:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/phc2sys-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=sync PHC with system clock (grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -w&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Create a service file for the ptp server:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Enable and start these services&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl enable ptp4l-grandmaster.service&lt;br /&gt;
 sudo systemctl start phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl start ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on the client ===&lt;br /&gt;
&lt;br /&gt;
Make a new service file&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-client.service&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Client)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2 -m --summary_interval 3&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Also, enable and start this service:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable ptp4l-client.service&lt;br /&gt;
 sudo systemctl start ptp4l-client.service&lt;br /&gt;
&lt;br /&gt;
Check the status of the client when all is in place&lt;br /&gt;
 sudo systemctl status ptp4l-client&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8749</id>
		<title>Ricbot PTP</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8749"/>
		<updated>2026-04-20T12:29:08Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Test time master */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== PTP ==&lt;br /&gt;
&lt;br /&gt;
Precise Time Protocol (on Raspberry Pi 5)&lt;br /&gt;
&lt;br /&gt;
Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Install on both master and slave:&lt;br /&gt;
 sudo apt install linuxptp&lt;br /&gt;
&lt;br /&gt;
Verify that there is support on &#039;eth0&#039;.&lt;br /&gt;
Should have hardware capabilities:&lt;br /&gt;
&lt;br /&gt;
 $ ethtool -T eth0&lt;br /&gt;
 Time stamping parameters for eth0:&lt;br /&gt;
 Capabilities:&lt;br /&gt;
        hardware-transmit&lt;br /&gt;
        software-transmit&lt;br /&gt;
        hardware-receive&lt;br /&gt;
        software-receive&lt;br /&gt;
        software-system-clock&lt;br /&gt;
        hardware-raw-clock&lt;br /&gt;
&lt;br /&gt;
=== Test time master ===&lt;br /&gt;
&lt;br /&gt;
Start connection to eth0 hardware (as a process in the background)&lt;br /&gt;
&lt;br /&gt;
 sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Start clock master service on eth0&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2&lt;br /&gt;
&lt;br /&gt;
It should be activated as a grand master soon.&lt;br /&gt;
&lt;br /&gt;
=== Test time client ===&lt;br /&gt;
&lt;br /&gt;
Run a PTP test slave (-s) with output to console (-m).&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
After a few minutes, this should yield a time offset on the order of 100 ns.&lt;br /&gt;
&lt;br /&gt;
Kill the phc2sys on the time server after the client test:&lt;br /&gt;
 sudo pkill phc2sys&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on Master ===&lt;br /&gt;
&lt;br /&gt;
Most is copied from https://austinsnerdythings.com/2025/02/18/nanosecond-accurate-ptp-server-grandmaster-and-client-tutorial-for-raspberry-pi/.&lt;br /&gt;
&lt;br /&gt;
Create a service file for the connection to eth0:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/phc2sys-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=sync PHC with system clock (grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -w&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Create a service file for the ptp server:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Enable and start these services&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl enable ptp4l-grandmaster.service&lt;br /&gt;
 sudo systemctl start phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl start ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on the client ===&lt;br /&gt;
&lt;br /&gt;
Make a new service file&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-client.service&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Client)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2 -m --summary_interval 3&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Also, enable and start this service:&lt;br /&gt;
&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable ptp4l-client.service&lt;br /&gt;
sudo systemctl start ptp4l-client.service&lt;br /&gt;
&lt;br /&gt;
Check the status of the client when all is in place&lt;br /&gt;
 sudo systemctl status ptp4l-client&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8748</id>
		<title>Ricbot PTP</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8748"/>
		<updated>2026-04-20T12:28:36Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Test time client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== PTP ==&lt;br /&gt;
&lt;br /&gt;
Precise Time Protocol (on Raspberry Pi 5)&lt;br /&gt;
&lt;br /&gt;
Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Install on both master and slave:&lt;br /&gt;
 sudo apt install linuxptp&lt;br /&gt;
&lt;br /&gt;
Verify that there is support on &#039;eth0&#039;.&lt;br /&gt;
Should have hardware capabilities:&lt;br /&gt;
&lt;br /&gt;
 $ ethtool -T eth0&lt;br /&gt;
 Time stamping parameters for eth0:&lt;br /&gt;
 Capabilities:&lt;br /&gt;
        hardware-transmit&lt;br /&gt;
        software-transmit&lt;br /&gt;
        hardware-receive&lt;br /&gt;
        software-receive&lt;br /&gt;
        software-system-clock&lt;br /&gt;
        hardware-raw-clock&lt;br /&gt;
&lt;br /&gt;
=== Test time master ===&lt;br /&gt;
&lt;br /&gt;
Start connection to eth0 hardware (as a process in the background)&lt;br /&gt;
&lt;br /&gt;
 sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Start clock master service on eth0&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
It should be activated as a grand master soon.&lt;br /&gt;
&lt;br /&gt;
=== Test time client ===&lt;br /&gt;
&lt;br /&gt;
Run a PTP test slave (-s) with output to console (-m).&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
After a few minutes, this should yield a time offset on the order of 100 ns.&lt;br /&gt;
&lt;br /&gt;
Kill the phc2sys on the time server after the client test:&lt;br /&gt;
 sudo pkill phc2sys&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on Master ===&lt;br /&gt;
&lt;br /&gt;
Most is copied from https://austinsnerdythings.com/2025/02/18/nanosecond-accurate-ptp-server-grandmaster-and-client-tutorial-for-raspberry-pi/.&lt;br /&gt;
&lt;br /&gt;
Create a service file for the connection to eth0:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/phc2sys-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=sync PHC with system clock (grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -w&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Create a service file for the ptp server:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Enable and start these services&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl enable ptp4l-grandmaster.service&lt;br /&gt;
 sudo systemctl start phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl start ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on the client ===&lt;br /&gt;
&lt;br /&gt;
Make a new service file&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-client.service&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Client)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2 -m --summary_interval 3&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Also, enable and start this service:&lt;br /&gt;
&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable ptp4l-client.service&lt;br /&gt;
sudo systemctl start ptp4l-client.service&lt;br /&gt;
&lt;br /&gt;
Check the status of the client when all is in place&lt;br /&gt;
 sudo systemctl status ptp4l-client&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8747</id>
		<title>Ricbot PTP</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_PTP&amp;diff=8747"/>
		<updated>2026-04-20T12:27:32Z</updated>

		<summary type="html">&lt;p&gt;Jca: Created page with &amp;quot;Back to Ricbot  == PTP ==  Precise Time Protocol (on Raspberry Pi 5)  Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.  === Install ===  Install on both master and slave:  sudo apt install linuxptp  Verify that there is support on &amp;#039;eth0&amp;#039;. Should have hardware capabilities:   $ ethtool -T eth0  Time stamping parameters for eth0:  Capabilities:         hardware-transmit         software-transmit         hardware-receive...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== PTP ==&lt;br /&gt;
&lt;br /&gt;
Precise Time Protocol (on Raspberry Pi 5)&lt;br /&gt;
&lt;br /&gt;
Assuming 2 Raspberry Pis are connected with an Ethernet cable, and both have an IP on eth0.&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Install on both master and slave:&lt;br /&gt;
 sudo apt install linuxptp&lt;br /&gt;
&lt;br /&gt;
Verify that there is support on &#039;eth0&#039;.&lt;br /&gt;
Should have hardware capabilities:&lt;br /&gt;
&lt;br /&gt;
 $ ethtool -T eth0&lt;br /&gt;
 Time stamping parameters for eth0:&lt;br /&gt;
 Capabilities:&lt;br /&gt;
        hardware-transmit&lt;br /&gt;
        software-transmit&lt;br /&gt;
        hardware-receive&lt;br /&gt;
        software-receive&lt;br /&gt;
        software-system-clock&lt;br /&gt;
        hardware-raw-clock&lt;br /&gt;
&lt;br /&gt;
=== Test time master ===&lt;br /&gt;
&lt;br /&gt;
Start connection to eth0 hardware (as a process in the background)&lt;br /&gt;
&lt;br /&gt;
 sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Start clock master service on eth0&lt;br /&gt;
&lt;br /&gt;
 sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
It should be activated as a grand master soon.&lt;br /&gt;
&lt;br /&gt;
=== Test time client ===&lt;br /&gt;
&lt;br /&gt;
Run a PTP test slave (-s) with output to console (-m).&lt;br /&gt;
&lt;br /&gt;
sudo ptp4l -i eth0 -m -2 -s &lt;br /&gt;
&lt;br /&gt;
After a few minutes, this should yield a time offset on the order of 100 ns.&lt;br /&gt;
&lt;br /&gt;
Kill the phc2sys on the time server after the client test:&lt;br /&gt;
 sudo pkill phc2sys&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on Master ===&lt;br /&gt;
&lt;br /&gt;
Most is copied from https://austinsnerdythings.com/2025/02/18/nanosecond-accurate-ptp-server-grandmaster-and-client-tutorial-for-raspberry-pi/.&lt;br /&gt;
&lt;br /&gt;
Create a service file for the connection to eth0:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/phc2sys-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=sync PHC with system clock (grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -w&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Create a service file for the ptp server:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Grandmaster)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Enable and start these services&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl enable phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl enable ptp4l-grandmaster.service&lt;br /&gt;
 sudo systemctl start phc2sys-grandmaster.service&lt;br /&gt;
 sudo systemctl start ptp4l-grandmaster.service&lt;br /&gt;
&lt;br /&gt;
=== Install as a service on the client ===&lt;br /&gt;
&lt;br /&gt;
Make a new service file&lt;br /&gt;
 sudo nano /etc/systemd/system/ptp4l-client.service&lt;br /&gt;
With:&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=Precision Time Protocol (PTP) service (Client)&lt;br /&gt;
 After=network-online.target&lt;br /&gt;
 Wants=network-online.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/sbin/ptp4l -i eth0 -2 -m --summary_interval 3&lt;br /&gt;
 Restart=always&lt;br /&gt;
 RestartSec=3&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Also, enable and start this service:&lt;br /&gt;
&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable ptp4l-client.service&lt;br /&gt;
sudo systemctl start ptp4l-client.service&lt;br /&gt;
&lt;br /&gt;
Check the status of the client when all is in place&lt;br /&gt;
 sudo systemctl status ptp4l-client&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8746</id>
		<title>Ricbot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8746"/>
		<updated>2026-04-20T12:26:41Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Installation notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Ricbot, a wheeled sensor platform == &lt;br /&gt;
&lt;br /&gt;
Ricbot is intended for fast deployment to areas of interest.&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* Reused motors and wheels from an old &amp;quot;Elector Wheelie&amp;quot; platform&lt;br /&gt;
* Designed to fit into a normal car for deployment, i.e can be disassembled to no more than 55cm in height.&lt;br /&gt;
* No more than 25-30 kg, requiring 1 or 2 persons to load or unload.&lt;br /&gt;
* Wheel-odometry recording (and timestamped)&lt;br /&gt;
* Camera image recording (and timestamped), the intention is Realsense D435.&lt;br /&gt;
* Maybe GNSS recording too.&lt;br /&gt;
* Manual remote control.&lt;br /&gt;
&lt;br /&gt;
== User support ==&lt;br /&gt;
&lt;br /&gt;
* [[RIC start and stop | Start, drive and stop]]&lt;br /&gt;
* [[RIC data recording | Data recording]]&lt;br /&gt;
&lt;br /&gt;
== Installation notes == &lt;br /&gt;
&lt;br /&gt;
* [[Ricbot hardware]]&lt;br /&gt;
* Ricbot installation of [[Ricbot realsense | Realsense]]&lt;br /&gt;
* [[Ricbot ROS2 | ROS2]] including bridge from MQTT to ROS2 messaging&lt;br /&gt;
* [[Ricbot GNSS | GNSS]] installation, including &#039;gpsd&#039;&lt;br /&gt;
* [[Ricbot PTP | PTP]] time synchronization.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8745</id>
		<title>Ricbot</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot&amp;diff=8745"/>
		<updated>2026-04-20T12:21:48Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* User support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Ricbot, a wheeled sensor platform == &lt;br /&gt;
&lt;br /&gt;
Ricbot is intended for fast deployment to areas of interest.&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* Reused motors and wheels from an old &amp;quot;Elector Wheelie&amp;quot; platform&lt;br /&gt;
* Designed to fit into a normal car for deployment, i.e can be disassembled to no more than 55cm in height.&lt;br /&gt;
* No more than 25-30 kg, requiring 1 or 2 persons to load or unload.&lt;br /&gt;
* Wheel-odometry recording (and timestamped)&lt;br /&gt;
* Camera image recording (and timestamped), the intention is Realsense D435.&lt;br /&gt;
* Maybe GNSS recording too.&lt;br /&gt;
* Manual remote control.&lt;br /&gt;
&lt;br /&gt;
== User support ==&lt;br /&gt;
&lt;br /&gt;
* [[RIC start and stop | Start, drive and stop]]&lt;br /&gt;
* [[RIC data recording | Data recording]]&lt;br /&gt;
&lt;br /&gt;
== Installation notes == &lt;br /&gt;
&lt;br /&gt;
* [[Ricbot hardware]]&lt;br /&gt;
* Ricbot installation of [[Ricbot realsense | Realsense]]&lt;br /&gt;
* [[Ricbot ROS2 | ROS2]] including bridge from MQTT to ROS2 messaging&lt;br /&gt;
* [[Ricbot GNSS | GNSS]] installation, including &#039;gpsd&#039;&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8744</id>
		<title>Ricbot GNSS</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Ricbot_GNSS&amp;diff=8744"/>
		<updated>2026-04-20T12:20:15Z</updated>

		<summary type="html">&lt;p&gt;Jca: Created page with &amp;quot;Back to Ricbot  == GNSS ==  Satellite positioning is implemented using a NEO-M9V receiver. The receiver is connected to the navigation Raspberry Pi.  === Decode and publish ===  Using the &amp;#039;gpsd&amp;#039; publisher. This should be easily interfaced to ROS. (not implemented yet)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== GNSS ==&lt;br /&gt;
&lt;br /&gt;
Satellite positioning is implemented using a NEO-M9V receiver.&lt;br /&gt;
The receiver is connected to the navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
=== Decode and publish ===&lt;br /&gt;
&lt;br /&gt;
Using the &#039;gpsd&#039; publisher. This should be easily interfaced to ROS.&lt;br /&gt;
(not implemented yet)&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=RIC_data_recording&amp;diff=8743</id>
		<title>RIC data recording</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=RIC_data_recording&amp;diff=8743"/>
		<updated>2026-04-20T12:16:17Z</updated>

		<summary type="html">&lt;p&gt;Jca: /* Camera data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Ricbot]]&lt;br /&gt;
&lt;br /&gt;
== Data recording ==&lt;br /&gt;
&lt;br /&gt;
=== Internal robot data ===&lt;br /&gt;
&lt;br /&gt;
Handled by the (left) navigation Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
By default, the Teensy interface (teensy_interface) runs on the Raspberry Pi.&lt;br /&gt;
This will record most of the available data, like:&lt;br /&gt;
* Odometry&lt;br /&gt;
* Gyro and accelerometer data from the on-board IMU.&lt;br /&gt;
* Motor voltage and velocity of each wheel.&lt;br /&gt;
* MQTT communication&lt;br /&gt;
* GNSS data (when operational)&lt;br /&gt;
&lt;br /&gt;
This data will be on the Pi in this directory&lt;br /&gt;
 /home/local/svn/robobot/teensy_interface/build/log_yyyymmdd_hhmmss&lt;br /&gt;
The date and time part will be when the interface started. Note that for now, it requires the Pi to be on a public network. If not, the date will be the last proper shutdown date.&lt;br /&gt;
&lt;br /&gt;
The intention is to adjust the time if GNSS coverage is available, but this has not yet been implemented.&lt;br /&gt;
&lt;br /&gt;
=== Camera data ===&lt;br /&gt;
&lt;br /&gt;
Handled by the right Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
For now, image capture starts at boot via the script &#039;on_reboot.bash&#039; in the home directory of the user &#039;local&#039;.&lt;br /&gt;
&lt;br /&gt;
The RealSense example code &#039;rs-save-to-disk&#039; has been modified to save data from a single camera.&lt;br /&gt;
&lt;br /&gt;
It takes 2 parameters, like:&lt;br /&gt;
 rs-save-to-disk 1234567890 D455&lt;br /&gt;
where the camera serial number is the first parameter, and the camera type is the second. &lt;br /&gt;
&lt;br /&gt;
For now, D455 will run at 5 FPS, and D435 at 6 FPS.&lt;br /&gt;
Both camera types will save one imageset per second. An imageset consists of an RGB image (in PNG format) and a coloured point cloud (in PYR format).&lt;br /&gt;
&lt;br /&gt;
=== Time stamping ===&lt;br /&gt;
&lt;br /&gt;
The two Raspberry Pis are connected via a network cable and time-synchronised using PTP.&lt;br /&gt;
The navigation Raspberry is the time master.&lt;/div&gt;</summary>
		<author><name>Jca</name></author>
	</entry>
</feed>