-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplatformio.ini
More file actions
247 lines (216 loc) · 9.47 KB
/
platformio.ini
File metadata and controls
247 lines (216 loc) · 9.47 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
; Please visit the PlatformIO documentation for other options and examples
; https://docs.platformio.org/page/projectconf.html
; Everything below is all the special configuration to run FCOS for various
; Foxie Clock environments (initially, just the FC2 and the CardClock)
[platformio]
build_dir = bin
[env]
lib_deps = googletest
test_framework = googletest
build_flags = !python get_version.py
-D FW_VERSION_ADDR=\"github.com/foxieproducts/fcos/raw/main/release.md\"
-std=c++17
[env:fc2-esp32c3]
framework = arduino
platform = https://github.com/platformio/platform-espressif32.git
; Adafruit's QT Py ESP32-C3 configuration uses the internal USB CDC serial
; port and is a closer match to the Foxie Clock 2.0 PCB than the
; Espressif ESP32-C3 devkit.
board = adafruit_qtpy_esp32c3
; However... the QT Py config uses DIO, while the ESP32-C3-Mini on the
; FC2 board needs QIO so that LittleFS works.
board_build.flash_mode = qio
; normally the filesystem gets most of the space, but this can be enabled to allow more code space
; board_build.partitions = huge_app.csv
lib_deps = ArduinoJson@6.21.5
HTTPClient
LittleFS
NeoPixelBus@2.7.9
Wire
elpaso/Rtc_Pcf8563
paulstoffregen/Time@^1.6.1
jchristensen/Timezone@^1.2.4
WiFi
https://github.com/tzapu/WiFiManager.git
sv-zanshin/BME680@^1.0.12
build_flags = ${env.build_flags}
-D FCOS_FOXIECLOCK
-D FCOS_ESP32_C3
-D FW_DOWNLOAD_ADDRESS=\"github.com/foxieproducts/fcos/raw/main/bin/fc2-esp32c3/firmware.bin\"
-D PIN_LEDS=2
-D PIN_LIGHT_SENSOR=1
-D PIN_RTC_INTERRUPT=0
-D PIN_BTN_UP=10
-D PIN_BTN_DOWN=7
-D PIN_BTN_LEFT=4
-D PIN_BTN_RIGHT=9
-D PIN_BTN_PRESS=3
-D WM_NODEBUG
; upload_protocol = espota
; upload_port = 192.168.1.92
; Note that specifying baud rates is not necessary for the
; esp32c3, due to its self contained USB Serial and USB JTAG
; hardware. What a time to be alive, right?
; Debugging _should_ be possible on the FC2 board, but it's not
; currently easy to setup within PlatformIO building Arduino-
; style code. It requires a much larger amount of external setup.
; https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-guides/jtag-debugging/index.html
;
; To debug, first prepare the environment.
; # source $HOME/esp/esp-idf/export.sh
;
; Then, start OpenOCD:
; # openocd -f board/esp32c3-builtin.cfg
;
; Then: ???
; Profit!
[env:cc2-esp32c3]
framework = arduino
platform = https://github.com/platformio/platform-espressif32.git
board = adafruit_qtpy_esp32c3
board_build.flash_mode = qio
lib_deps = ArduinoJson@6.21.5
HTTPClient
LittleFS
NeoPixelBus@2.7.9
Wire
elpaso/Rtc_Pcf8563
paulstoffregen/Time@^1.6.1
jchristensen/Timezone@^1.2.4
WiFi
https://github.com/tzapu/WiFiManager.git
sv-zanshin/BME680@^1.0.12
build_flags = ${env.build_flags}
-D FCOS_CARDCLOCK2
-D FCOS_ESP32_C3
-D FW_DOWNLOAD_ADDRESS=\"github.com/foxieproducts/fcos/raw/main/bin/cc2-esp32c3/firmware.bin\"
-D PIN_LEDS=2
-D PIN_LIGHT_SENSOR=1
-D PIN_RTC_INTERRUPT=0
-D PIN_BTN_UP=10
-D PIN_BTN_DOWN=7
-D PIN_BTN_LEFT=4
-D PIN_BTN_RIGHT=9
-D PIN_BTN_PRESS=3
-D WM_NODEBUG
; upload_protocol = espota
; upload_port = 192.168.1.100
[env:host-unit-testing]
; this is only used for running unit tests in the native host
; environment, which is FAR faster than running on the target
platform = native
lib_deps = ${env.lib_deps}`
build_flags = ${env:fc2-esp32c3.build_flags}
[env:fc2-esp32c3-testing]
; buuuuut.... we can run them on the target if we're careful.
; All external library dependencies are removed because they
; aren't all compatible the unit testing environment
framework = ${env:fc2-esp32c3.framework}
platform = ${env:fc2-esp32c3.platform}
board = ${env:fc2-esp32c3.board}
lib_deps = ${env.lib_deps}
build_flags = ${env:fc2-esp32c3.build_flags}
[env:fc2-esp8266]
framework = arduino
platform = espressif8266
board = esp12e ;also supports the ESP-12F
board_build.filesystem = littlefs
lib_deps = ESP8266HTTPClient
ESP8266httpUpdate
ESP8266WiFi
ESP8266mDNS
ArduinoJson@6.21.5
LittleFS
NeoPixelBus@2.7.9
Wire
elpaso/Rtc_Pcf8563
paulstoffregen/Time@^1.6.1
jchristensen/Timezone@^1.2.4
https://github.com/tzapu/WiFiManager.git@^2.0
build_flags = ${env.build_flags}
-D FCOS_FOXIECLOCK
-D FCOS_ESP8266
-D FW_DOWNLOAD_ADDRESS=\"github.com/foxieproducts/fcos/raw/main/bin/fc2-esp8266/firmware.bin\"
-D PIN_LEDS=15
-D PIN_LIGHT_SENSOR=A0
-D PIN_RTC_INTERRUPT=13
-D PIN_BTN_UP=14
-D PIN_BTN_DOWN=12
-D PIN_BTN_LEFT=10
-D PIN_BTN_RIGHT=0
-D PIN_BTN_PRESS=2
upload_speed = 921600
monitor_speed = 115200
; Welcome to the platformio config file, and thanks for digging enough to find this :)
; Your reward is a _cool story, bro_ from yours, truly. Congratulations ;)
;
; The very first FC2 prototype in early 2021 was my first PCB using a naked ESP-12F.
; It was designed to use 3x Foxie "DoubleDigit" modules (a small ~60x30mm PCB, each of
; which had 40x LEDs), had 128 total LEDs and 5 buttons. Email me for a pic ;)
; The DoubleDigit modules had two Ds, for a double dose of pimping. #iykyk
;
; After assembling the first prototype, though it worked (yay!), I realized it was a
; design destined for the trash bin. I needed to return to the drawing board. It had
; so many flaws:
; 1. 5 separate buttons! (I didn't know this was a flaw until after the CC 1.0, sadly)
; 2. 1 PCB + soldering 3 PCBs to it? Instead of just 1 PCB?
; Repeat after me: Less is more.
; 3. I still hadn't thought to make the PCB itself be the bottom of the clock
; 4. It just didn't look... better than the previous one.
; 5. Even though attaching 3x DoubleDigits was funny and unique, it wasn't enough to
; overcome the less-than-optimal design.
;
; BUT, I _had_ validated my circuit design! Oh baby! I had been considering making
; a PCB business card, as a rite of passage for a fledgling amateur PCB designer,
; so I shortly came up with the idea to make my own flavor of a simple clock on a
; credit/business-card sized PCB. My idea was to do that while I was thinking about
; how to make the FC2 design as good as possible.
;
; That led to the CardClock 1.0 (https://github.com/foxieproducts/cardclock),
; released in September of 2021, but I only shipped a dozen of them! It was received
; extremely well, but I had yield problems with the buttons on the initial PCB run.
; Thank you to all of you that immediately bought all 12 of my CardClock 1.0s before I
; ran out of stock. You are all incredible people and I'm so grateful for your support.
; The reason I only shipped a dozen was largely due to the fact that I had a lot of
; heavy real life stuff happening that took priority for the next 6 months.
; Fun fact: The first CC prototype had 11 LEDs across the top of the PCB,
; which were meant to use edge-lighting to light up a laser cut acrylic piece over the
; top of the PCB. Did it "work"? Technically, yes. But it wasn't good ;) The final
; CC 1.0 prototypes were much better, with 24 LEDs for the hours/minutes. Iteration
; is so important to the creative process.
;
; In March of 2022, I was finally ready to restart work on the FC2 design. After I had
; finally come up with answers for where I wanted to put everything, I started modeling
; out the clock (including PCB) within Fusion360. I initially used roughly the same CC
; schematic for the FC2. The very first 5 prototypes in April 2022 were ESP-12F-based,
; and had 82 WS2812B-Mini LEDs and only 8x WS2812B-2020 LEDs (same as I used in the CC 1.0).
;
; They all worked, amazingly. My case design fit and the joystick was better than I
; had hoped. Plus, the joystick largely solves the yield issue I had with the CC buttons.
;
; Finally, I got ready to order the first run of 50 ESP-12F-based FC2 PCBs... and...
; my supplier no longer would assemble with the WS2812B-Mini or WS2812B-2020 LEDs, because
; their other customers' PCBs had been having major reliability issues with these LEDs. Sigh.
;
; F^@#$&%!! I needed to make major PCB changes, yet again.
;
; I decided that since I had to replace all the LEDs with TC2020s, I should do one
; more prototype run. And since I had to do that, I wanted to test out the new
; ESP32-C3-MINI. Nobody can say I'm not bold.
; So after redesigning... again, in May 2022, I ordered 5 new protos and was able to
; validate and finalize the FC2 ESP32-C3 schematic.
;
; This final redesign of the PCB resulted in a lot of improvements:
; 1. The ESP32-C3 supports BLE and is programmable over USB, without a separate USB
; to serial chip or adapter. This is SOOOOOOoooOOooo much nicer for development.
; 2. Added the up/down LEDs by the joystick
; 3. Added the QWICC connector
; 4. Lots of improvements to the labels on the PCB
; 5. Added a diode to protect against back-powering and ESD protection diodes
;
; I'm very happy with the results and I hope you are too. Thanks for reading!
;
; May the Schwartz be with you.
;
; Best,
; Will