-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-platformio.yaml
More file actions
97 lines (84 loc) · 3.06 KB
/
install-platformio.yaml
File metadata and controls
97 lines (84 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
- hosts: all
# run this: ansible-playbook -i raspberrypi.local, -u pi install-platformio.yaml
tasks:
- name: install latest udev rules
become: yes
get_url:
url: https://raw.githubusercontent.com/platformio/platformio-core/develop/scripts/99-platformio-udev.rules
dest: /etc/udev/rules.d/99-platformio-udev.rules
checksum: md5:f914ffef19ed3df117e615dc187b7754
owner: root
- name: install necessary packages
apt: name={{ item }}
become: yes
with_items:
- clang
- python-pip
- libusb-0.1-4
- python-backports.functools-lru-cache
# better use the ide for starters and make a soft link
- name: install necessary python packages
pip: name={{ item }} extra_args="--upgrade" executable=pip
become: yes
with_items:
- platformio
- name: put user in necessary groups
user:
name: "{{ ansible_env.USER }}"
groups: dialout,plugdev
append: yes
become: yes
- name: stop bluetooth stuff
systemd: name={{ item }} state=stopped enabled=no
become: yes
with_items:
- hciuart
- bluetooth
when: ansible_lsb.id == "Raspbian"
# from: http://docs.platformio.org/en/latest/platforms/atmelavr.html
- name: set serial to on
command: raspi-config nonint dtoverlay=pi3-disable-bt
become: yes
when: ansible_lsb.id == "Raspbian"
- name: set uart according to https://www.raspberrypi.org/documentation/configuration/uart.md
lineinfile: dest="{{ item.dest }}" line="{{ item.line }}"
with_items:
- { dest: "/boot/config.txt", line: "enable_uart=1" }
- { dest: "/boot/config.txt", line: "dtoverlay=pi3-disable-bt" }
become: yes
when: ansible_lsb.id == "Raspbian"
- name: set uart according to 'https://hallard.me/enable-serial-port-on-raspberry-pi/'
replace:
path: /boot/config.txt
regexp: 'enable_uart=0'
replace: 'enable_uart=1'
backup: yes
become: yes
when: ansible_lsb.id == "Raspbian"
# # SEE BELOW
# - name: set raspberry options
# command: {{ item | quote }}
# become: yes
# with_items:
# # - raspi-config nonint do_expand_rootfs
# # - raspi-config nonint do_hostname {{ hostname }}
# # - raspi-config nonint do_boot_behaviour B1
# # - raspi-config nonint do_boot_behaviour B2
# # - raspi-config nonint do_boot_behaviour B3
# # - raspi-config nonint do_boot_behaviour B4
# # - raspi-config nonint do_boot_wait 1
# # - raspi-config nonint do_boot_splash 1
# # - raspi-config nonint do_overscan 1
# # - raspi-config nonint do_camera 1
# # - raspi-config nonint do_ssh 1
# # - raspi-config nonint do_vnc 1
# # - raspi-config nonint do_spi 1
# # - raspi-config nonint do_i2c 1
# - raspi-config nonint do_serial 1
# # - raspi-config nonint do_onewire 1
# # - raspi-config nonint do_rgpio 1
# # - raspi-config nonint do_overclock %s
# # - raspi-config nonint do_memory_split 1
# # - raspi-config nonint do_resolution %d %d
# # - raspi-config nonint do_wifi_country %s