Giter Site home page Giter Site logo

esp8266-http-health-checker's Introduction

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
  • 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

./bootstrap.sh

Example output

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

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

Example output

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.