Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/scott-the-programmer/esp8266-http-health-checker

A simple health checker running on the esp8266 board
https://github.com/scott-the-programmer/esp8266-http-health-checker

Last synced: 16 days ago
JSON representation

A simple health checker running on the esp8266 board

Awesome Lists containing this project

README

        

# ESP8266 Http Health Check

A simple health checker that flashes an LED based on whether an endpoint is healthy or not

Supports both http and https endpoints

## Prerequisites

* [Arduino CLI](https://arduino.github.io/arduino-cli/installation/)
* CP210x USB to UART Bridge VCP Driver
* openssl

## Getting Started

Run the following script to list out your connected boards and update the ardunio-cli repository with the esp8266 index

```bash
./bootstrap.sh
```

Example output

```bash
These are the boards connected
Port Type Board Name FQBN Core
/dev/cu.usbserial-14310 Serial Port (USB) Unknown

Updating arduino index
Updating index: package_index.json downloaded
Updating index: package_esp8266com_index.json downloaded
Downloading esp8266 dependencies
esp8266:[email protected] already downloaded
esp8266:[email protected] already downloaded
esp8266:[email protected] already downloaded
esp8266:[email protected] already downloaded
esp8266:[email protected] already downloaded
```

Take note of the port that you want to use, in this case, `/dev/cu.usbserial-14310`

## Build & Run the code

Run the following script to compile and run the code

```bash
./run.sh "/dev/cu.usbserial-14310" "https://example/example-endpoint" "SSID" "password"
```

Example output

```bash
Compiling code
Executable segment sizes:
IROM : 228492 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26784 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1248 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 688 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 24880 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 257212 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 26816 bytes (32%) of dynamic memory, leaving 55104 bytes for local variables. Maximum is 81920 bytes.
Deploying code to esp8266:esp8266:nodemcuv2:xtal=80 on /dev/cu.usbserial-143120
No new serial port detected.
esptool.py v2.8
Serial port /dev/cu.usbserial-143120
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 50:02:91:7a:1d:f2
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 261360 bytes to 192957...
Wrote 261360 bytes (192957 compressed) at 0x00000000 in 18.7 seconds (effective 111.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
```

Run the following command to read the serial output

```bash
cat < "/dev/cu.usbserial-14320"
```