-
Notifications
You must be signed in to change notification settings - Fork 0
Ubuntu OS configuration
This page describes the process to configure Ubuntu 24.04 to interface with the vehicle sensors and run docker containers
In order to configure the network properly, we need to migrate the configuration files/settings that the previous CentOS 7 had to communcate with the sensors.
The sever neeeds two configurations: the network interface and the dhcp server.
CentOS7 ifconfig
output:
enp129s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.27.28.69 netmask 255.255.252.0 broadcast 172.27.31.255
inet6 fe80::ae1f:6bff:fe8a:5218 prefixlen 64 scopeid 0x20<link>
ether ac:1f:6b:8a:52:18 txqueuelen 1000 (Ethernet)
RX packets 3004 bytes 863431 (843.1 KiB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 523 bytes 46865 (45.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp129s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.31.0.1 netmask 255.255.0.0 broadcast 172.31.255.255
inet6 fe80::ae1f:6bff:fe8a:5219 prefixlen 64 scopeid 0x20<link>
ether ac:1f:6b:8a:52:19 txqueuelen 1000 (Ethernet)
RX packets 1129 bytes 102963 (100.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2198 bytes 380183 (371.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp129s0f1:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.2.0.81 netmask 255.255.0.0 broadcast 10.2.255.255
ether ac:1f:6b:8a:52:19 txqueuelen 1000 (Ethernet)
enp129s0f1.101: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.0.81 netmask 255.255.0.0 broadcast 10.1.255.255
inet6 fe80::ae1f:6bff:fe8a:5219 prefixlen 64 scopeid 0x20<link>
ether ac:1f:6b:8a:52:19 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 667 bytes 41746 (40.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
We need to recplicate this settings in Ubuntu.
Ubuntu uses Netplan to configure networks based on YAML files
Based on CentOS ifcfg-enp129s0f1
and route-enp129s0f1
configuration files:
# ifcfg-enp129s0f1
DEVICE="enp129s0f1"
TYPE="Ethernet"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="172.31.0.1"
NETMASK="255.255.0.0"
NM_CONTROLLED="no"
IPV6INIT="no"
ZONE="sensor-lan"
DEFROUTE="no"
ETHTOOL_OPTS="-L ${DEVICE} combined 16; -A ${DEVICE} autoneg off tx off rx off"
# route-enp129s0f1
0.2.0.0/16 dev enp129s0f1
Ubuntu 24.04 by default sets both enp129s0f1
and enp129s0f0
both to be DHCP4 clients by default due to Cloud configuration (???) and automatically defines /etc/netplan/50-cloud-init.yaml
:
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp129s0f0:
dhcp4: true
enp129s0f1:
dhcp4: true
version: 2
As per file description, we created a /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
file with the network: {config: disabled}
But also the contents inside 50-cloud-init.yaml
file was commented as clashes with the target configuration which is deactivating dhcp4 client on enp129s0f1
A 40_lxo_network_config.yaml
file was created with chmod 600
to avoid warnings:
network:
version: 2
ethernets:
enp129s0f0:
dhcp4: true
enp129s0f1:
addresses:
- 172.31.0.1/16 # /16 corresponds to a subnet mask of 255.255.0.0
dhcp4: false
dhcp6: false
routes:
- to: default
via: 172.31.0.1
Changes are applied with sudo netplan apply
.
This ubuntu netlplan tutorial suggests using renderer: networkd
however, this casues issues on the configuration and it was omitted. This will cause the NetworkManager
to use it
The vehicle interact with IMU, cameras, datspped dbw and pico temp sensors via usb.
Five left a bunch of udev rules files in /etc/udev/rules.d
40-pgr.rules
70-snap.snapd.rules
90-camera-trigger.rules
90-dataspeed.rules
90-imu.rules
90-pico.rules
90-transportssd.rules
It easy to identiy that custom rules as the system do not use 90-
perfix`
Based on this we will define the following rules:
90-imu.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{product}=="Lord Inertial Sensor", ATTRS{serial}=="0000__6254.75215", SYMLINK+="imu-front", MODE="0666"
The udev rules also contained another 20 IMUS configuration, based on this I was able to know which usb credentials belong to the boot imu
Bus 003 Device 018: ID 0483:5740 STMicroelectronics Virtual COM Por
# with udevadm info --query=all --name=/dev/ttyACM0
S: serial/by-path/pci-0000:00:14.0-usb-0:2:1.0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/tty/ttyACM0
E: DEVNAME=/dev/ttyACM0
E: MAJOR=166
E: MINOR=0
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=5139236294
E: ID_BUS=usb
E: ID_MODEL=Lord_Inertial_Sensor
E: ID_MODEL_ENC=Lord\x20Inertial\x20Sensor
E: ID_MODEL_ID=5740
E: ID_SERIAL=Lord_Microstrain_Lord_Inertial_Sensor_0000__6254.75204
E: ID_SERIAL_SHORT=0000__6254.75204
E: ID_VENDOR=Lord_Microstrain
E: ID_VENDOR_ENC=Lord\x20Microstrain
E: ID_VENDOR_ID=0483
E: ID_REVISION=0200
we add to 90-imu.rules
:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{product}=="Lord Inertial Sensor", ATTRS{serial}=="0000__6254.75204", SYMLINK+="imu-boot", MODE="0666"
Then appy udev changes
sudo udevadm control --reload-rules && sudo udevadm trigger