some work on configuring rns on dietpi
This commit is contained in:
+22
-3
@@ -3,6 +3,25 @@
|
|||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- dietpi
|
- dietpi
|
||||||
- oneenv
|
vars:
|
||||||
vars_files:
|
radios:
|
||||||
- secrets.yaml
|
B407:
|
||||||
|
name: B407
|
||||||
|
serialpath: /dev/serial/by-id/usb-1a86_USB_Single_Serial_54FC052298-if00
|
||||||
|
5678:
|
||||||
|
name: 5678
|
||||||
|
serialpath: /dev/serial/by-id/usb-1a86_USB_Single_Serial_54F7017826-if00
|
||||||
|
D77E:
|
||||||
|
name: D77E
|
||||||
|
serialpath: /dev/serial/by-id/usb-1a86_USB_Single_Serial_54F7017033-if00
|
||||||
|
XXXX:
|
||||||
|
enabled: "no"
|
||||||
|
name: XXXX
|
||||||
|
serialpath: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
|
||||||
|
|
||||||
|
# C123:
|
||||||
|
# name: C123
|
||||||
|
# serialpath: /dev/ttyACM1
|
||||||
|
# frequency: 915000000
|
||||||
|
# bandwidth: 125000
|
||||||
|
# txpower: 14
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
|
- name: Install pyenv
|
||||||
|
import_tasks: pyenv.yaml
|
||||||
|
|
||||||
- name: Install Reticulum Network Stack (RNS)
|
- name: Install Reticulum Network Stack (RNS)
|
||||||
import_tasks: rns.yaml
|
import_tasks: rns.yaml
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
- name: Install build environment
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
update_cache: true
|
||||||
|
cache_valid_time: 3600
|
||||||
|
pkg:
|
||||||
|
- git
|
||||||
|
- build-essential
|
||||||
|
- libssl-dev
|
||||||
|
- zlib1g-dev
|
||||||
|
- libbz2-dev
|
||||||
|
- libreadline-dev
|
||||||
|
- libsqlite3-dev
|
||||||
|
- curl
|
||||||
|
- libncursesw5-dev
|
||||||
|
- xz-utils
|
||||||
|
- tk-dev
|
||||||
|
- libxml2-dev
|
||||||
|
- libxmlsec1-dev
|
||||||
|
- libffi-dev
|
||||||
|
- liblzma-dev
|
||||||
|
- python3-pip
|
||||||
|
- python3-venv
|
||||||
|
|
||||||
|
- name: Check if pyenv is installed
|
||||||
|
stat:
|
||||||
|
path: /root/.pyenv
|
||||||
|
register: pyenv_installed
|
||||||
|
|
||||||
|
- name: Download pyenv install script
|
||||||
|
get_url:
|
||||||
|
url: https://pyenv.run
|
||||||
|
dest: /tmp/install_pyenv.sh
|
||||||
|
mode: 0755
|
||||||
|
when: not pyenv_installed.stat.exists
|
||||||
|
|
||||||
|
- name: Run install script
|
||||||
|
shell: /tmp/install_pyenv.sh
|
||||||
|
when: not pyenv_installed.stat.exists
|
||||||
|
|
||||||
|
- name: Add pyenv to .bashrc
|
||||||
|
blockinfile:
|
||||||
|
dest: "/home/dietpi/.bashrc"
|
||||||
|
block: |
|
||||||
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
|
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
marker: '# {mark} ANSIBLE MANAGED BLOCK - pyenv'
|
||||||
|
create: yes
|
||||||
|
|
||||||
|
- name: Add pyenv to .profile
|
||||||
|
blockinfile:
|
||||||
|
dest: "/home/dietpi/.profile"
|
||||||
|
block: |
|
||||||
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
|
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
marker: '# {mark} ANSIBLE MANAGED BLOCK - pyenv'
|
||||||
|
create: yes
|
||||||
@@ -1,4 +1,16 @@
|
|||||||
---
|
---
|
||||||
|
- name: Install the rns package
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: rns
|
||||||
|
state: present
|
||||||
|
break_system_packages: yes
|
||||||
|
|
||||||
|
- name: Install the lxmf package
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: lxmf
|
||||||
|
state: present
|
||||||
|
break_system_packages: yes
|
||||||
|
|
||||||
- name: Create systemd service for rns
|
- name: Create systemd service for rns
|
||||||
copy:
|
copy:
|
||||||
dest: /etc/systemd/system/rns.service
|
dest: /etc/systemd/system/rns.service
|
||||||
@@ -21,15 +33,10 @@
|
|||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: Ensure rns service is enabled and started
|
- name: Ensure rns service is configured
|
||||||
systemd:
|
|
||||||
name: rns.service
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
|
|
||||||
- name: Stop service for config file update
|
|
||||||
systemd:
|
systemd:
|
||||||
name: rns.service
|
name: rns.service
|
||||||
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
||||||
- name: Ensure Reticulum config directory exists
|
- name: Ensure Reticulum config directory exists
|
||||||
@@ -45,85 +52,34 @@
|
|||||||
[reticulum]
|
[reticulum]
|
||||||
enable_transport = True
|
enable_transport = True
|
||||||
share_instance = Yes
|
share_instance = Yes
|
||||||
instance_name = B407
|
instance_name = {{ansible_hostname}}
|
||||||
discover_interfaces = Yes
|
discover_interfaces = Yes
|
||||||
panic_on_interface_error = No
|
panic_on_interface_error = No
|
||||||
|
|
||||||
# If you're connecting to a large external network, you
|
|
||||||
# can use one or more external blackhole list to block
|
|
||||||
# spammy and excessive announces onto your network. This
|
|
||||||
# funtionality is especially useful if you're hosting public
|
|
||||||
# entrypoints or gateways. The list source below provides a
|
|
||||||
# functional example, but better, more timely maintained
|
|
||||||
# lists probably exist in the community.
|
|
||||||
|
|
||||||
# blackhole_sources = 521c87a83afb8f29e4455e77930b973b
|
|
||||||
|
|
||||||
[logging]
|
[logging]
|
||||||
# Valid log levels are 0 through 7:
|
loglevel = 3
|
||||||
# 0: Log only critical information
|
|
||||||
# 1: Log errors and lower log levels
|
|
||||||
# 2: Log warnings and lower log levels
|
|
||||||
# 3: Log notices and lower log levels
|
|
||||||
# 4: Log info and lower (this is the default)
|
|
||||||
# 5: Verbose logging
|
|
||||||
# 6: Debug logging
|
|
||||||
# 7: Extreme logging
|
|
||||||
loglevel = 4
|
|
||||||
|
|
||||||
# The interfaces section defines the physical and virtual
|
|
||||||
# interfaces Reticulum will use to communicate on. This
|
|
||||||
# section will contain examples for a variety of interface
|
|
||||||
# types. You can modify these or use them as a basis for
|
|
||||||
# your own config, or simply remove the unused ones.
|
|
||||||
|
|
||||||
[interfaces]
|
[interfaces]
|
||||||
|
|
||||||
[[Default Interface]]
|
[[Default Interface]]
|
||||||
type = AutoInterface
|
type = AutoInterface
|
||||||
enabled = Yes
|
enabled = Yes
|
||||||
[[RNode LoRa Interface]]
|
{% for key, radio in radios.items() %}
|
||||||
type = RNodeInterface
|
|
||||||
enabled = yes
|
|
||||||
port = /dev/ttyACM0
|
|
||||||
# Set frequency to 915 MHz (US ISM Band)
|
|
||||||
frequency = 915000000
|
|
||||||
# Set LoRa bandwidth to 125 KHz
|
|
||||||
bandwidth = 125000
|
|
||||||
# Set TX power to 7 dBm (5 mW)
|
|
||||||
txpower = 7
|
|
||||||
# Select spreading factor 8. Valid
|
|
||||||
# range is 7 through 12, with 7
|
|
||||||
# being the fastest and 12 having
|
|
||||||
# the longest range.
|
|
||||||
spreadingfactor = 8
|
|
||||||
# Select coding rate 5. Valid range
|
|
||||||
# is 5 throough 8, with 5 being the
|
|
||||||
# fastest, and 8 the longest range.
|
|
||||||
codingrate = 5
|
|
||||||
# You can configure the RNode to send
|
|
||||||
# out identification on the channel with
|
|
||||||
# a set interval by configuring the
|
|
||||||
# following two parameters.
|
|
||||||
id_callsign = B407
|
|
||||||
id_interval = 600
|
|
||||||
# For certain homebrew RNode interfaces
|
|
||||||
# with low amounts of RAM, using packet
|
|
||||||
# flow control can be useful. By default
|
|
||||||
# it is disabled.
|
|
||||||
# flow_control = False
|
|
||||||
# It is possible to limit the airtime
|
|
||||||
# utilisation of an RNode by using the
|
|
||||||
# following two configuration options.
|
|
||||||
# The short-term limit is applied in a
|
|
||||||
# window of approximately 15 seconds,
|
|
||||||
# and the long-term limit is enforced
|
|
||||||
# over a rolling 60 minute window. Both
|
|
||||||
# options are specified in percent.
|
|
||||||
# airtime_limit_long = 1.5
|
|
||||||
# airtime_limit_short = 33
|
|
||||||
|
|
||||||
- name: Start rns service after config update
|
[[RNode LoRa {{radio.name}}]]
|
||||||
systemd:
|
type = RNodeInterface
|
||||||
name: rns.service
|
enabled = {{ radio.enabled | default('yes') }}
|
||||||
state: started
|
port = {{ radio.serialpath | default('/dev/ttyACM0') }}
|
||||||
|
frequency = {{ radio.frequency | default(915000000) }}
|
||||||
|
bandwidth = {{ radio.bandwidth | default(125000) }}
|
||||||
|
txpower = {{ radio.txpower | default(7) }}
|
||||||
|
spreadingfactor = {{ radio.spreadingfactor | default(8) }}
|
||||||
|
codingrate = {{ radio.codingrate | default(5) }}
|
||||||
|
id_callsign = {{ radio.name | default(key) }}
|
||||||
|
id_interval = {{ radio.id_interval | default(600) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
# - name: Start rns service after config update
|
||||||
|
# systemd:
|
||||||
|
# name: rns.service
|
||||||
|
# state: started
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
kicad-small
|
kicad-small
|
||||||
rpi-imager
|
rpi-imager
|
||||||
vscodium-fhs
|
vscodium-fhs
|
||||||
|
ansible_2_18
|
||||||
|
usbutils
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user