From 94371b781a4a51ea4a4e794bede16e0e7dfa65e9 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Mon, 17 Jun 2024 14:00:30 +0200 Subject: [PATCH] pi: enable GPSD Signed-off-by: Frank Villaro-Dixon --- ansible/configure-server.yml | 31 +++++++++++++++++++++++++++++++ ansible/files/gpsd | 4 ++++ 2 files changed, 35 insertions(+) create mode 100644 ansible/files/gpsd diff --git a/ansible/configure-server.yml b/ansible/configure-server.yml index cf37413..2446c5c 100644 --- a/ansible/configure-server.yml +++ b/ansible/configure-server.yml @@ -55,6 +55,37 @@ line: "dtoverlay=pps-gpio,gpiopin=18" state: present + ## Enable UART for the GPS module + - name: Enable UART + lineinfile: + dest: /boot/config.txt + regexp: "^#?enable_uart=" + line: "enable_uart=1" + insertafter: EOF + state: present + + - name: Disable serial-getty@ttyS0 + systemd: + name: serial-getty@ttyS0 + enabled: no + state: stopped + + - name: copy gpsd config files + ansible.builtin.copy: + src: files/gpsd + dest: /etc/default/gpsd + owner: root + group: root + mode: 0644 + tags: gpsd + + - name: start and enable gpsd + systemd: + name: gpsd + enabled: yes + state: started + tags: gpsd + diff --git a/ansible/files/gpsd b/ansible/files/gpsd new file mode 100644 index 0000000..4722532 --- /dev/null +++ b/ansible/files/gpsd @@ -0,0 +1,4 @@ +START_DAEMON="true" +USBAUTO="true" +DEVICES="/dev/ttyS0" +GPSD_OPTIONS="-n" \ No newline at end of file