Build the two sketches with PlatformIO, add offline checks and rewrite the README

Sumbrella had no build definition: it was two .ino files to open in the Arduino
IDE. This adds one PlatformIO project per sketch (PlatformIO only converts a
*.ino sitting at the top of its own src_dir) and there is now a real, repeated
compile for the boards the project actually used:

  Projeto.ino       -> Arduino Nano        206 B RAM, 3508 B flash of 30720
  Fetch_rain.ino    -> ESP8266 ESP-01     28972 B RAM, 280119 B of 434160 flash

The boards come from the course poster kept in the repository (Sumbrella.pdf,
"Listagem de material": Arduino Nano and ESP8226 ESP-01), not from the code:
neither sketch names its board. The ESP-01 flash size is not given anywhere, so
the 512 KB variant is targeted.

Dependencies are now reproducible. LiquidCrystal_I2C comes from the PlatformIO
registry by name and version. DS3231 1.01 cannot: all 87 registry hits were
checked and none exposes class Time / getTimeStr() / DS3231(data, sclk), so it is
pinned to tag v1.01 of a mirror whose files were verified byte-for-byte equal to
the libs/DS3231 removed in 009066d. A clean clone compiles as it is.

The unused LCD stays unused and no sensor is invented: the only thing this commit
does to the sketches is compile them.

tests/ holds the checks that need no board, each with a negative selftest that
proves the check bites: secrets hygiene (secrets.h not tracked and ignored, the
example complete and placeholder-only, no credential literal in any tracked file)
and pin validity against the Nano and ESP-01 pin maps. run.sh builds both targets
and then runs them, exiting non-zero on any failure. .gitignore now covers the
PlatformIO artefacts (.pio/, *.bin, *.elf and friends).

README.md is rewritten in the common format, with the real build and test output.
Two things it no longer says, because they are not true of this repository: no
revision reachable from main ever contained a credential literal (the deleted
ESP8266_Fetching_Data.ino carried the string "<REDACTED>"), and the DS3231
dependency is not installable from the PlatformIO registry.

Known, left unfixed on purpose: the LCD is constructed and never written to; the
rain values are printed and discarded; loop() calls setup() on failure; and
libs/DS3231 is still reachable in the history before 009066d.
This commit is contained in:
Andre Neto
2026-10-08 16:11:49 +01:00
parent 009066d182
commit 5d4b62c40b
9 changed files with 733 additions and 22 deletions
+21
View File
@@ -20,3 +20,24 @@ foi retirada do repositório e tem de ser instalada à parte:
A remoção foi feita **no repositório** (índice e histórico a partir daqui); não
apaga nenhuma cópia da biblioteca que exista fora do Git, no disco do autor.
## Como a dependência é declarada agora
`lib_deps` em `platformio.ini` (projecto do `Projeto.ino`):
```ini
lib_deps =
https://github.com/whonore/DS3231.git#v1.01
```
A biblioteca **não está no registry oficial do PlatformIO**: foram verificados
os 87 resultados da pesquisa por `DS3231` e nenhum expõe a API que `Projeto.ino`
usa (`class Time` com o campo `hour`, `char *getTimeStr()`, e o construtor
`DS3231(data_pin, sclk_pin)`). Por isso fica fixa à tag `v1.01` de um espelho,
cujos ficheiros foram comparados byte a byte com o `libs/DS3231` que saiu deste
repositório: `DS3231.h`, `DS3231.cpp`, `hardware/avr/HW_AVR.h`,
`hardware/avr/HW_AVR_defines.h`, `keywords.txt` e `Documentation/version.txt`
têm o mesmo SHA-256, e `version.txt` diz 1.01 (25 de Agosto de 2014).
O espelho é uma cópia da biblioteca original, redistribuída sob a mesma licença
CC BY-NC-SA 3.0; continua a não ser este repositório a redistribuí-la.