This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function portForward(podName, localPort, remotePort) { | |
return new Promise((resolve, reject) => { | |
const child = spawn('oc', ['port-forward', podName, `${localPort}:${remotePort}`]); // , { stdio: 'inherit' }); | |
['exit', 'SIGINT', 'SIGUSR1', 'SIGUSR2', 'uncaughtException', 'SIGTERM'].forEach(signal => { | |
process.on(signal, () => { | |
child.stdin.pause(); | |
child.kill(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include "MHZ19.h" | |
#include <SoftwareSerial.h> | |
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#define RX_PIN 12 | |
#define TX_PIN 13 | |
#define BAUDRATE 9600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5Stack.h> | |
#include "Free_Fonts.h" | |
#include <Wire.h> | |
#include "DFRobot_SHT20.h" | |
#include <WiFi.h> | |
#include <PubSubClient.h> | |
#define TFT_GREY 0x7BEF | |
#define DATA_LEN 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include "Adafruit_MQTT.h" | |
#include "Adafruit_MQTT_Client.h" | |
#include <Wire.h> | |
#include <Adafruit_BMP280.h> | |
#define WLAN_SSID "*" | |
#define WLAN_PASS "*" | |
#define SERVER "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "LowPower.h" | |
#define TONE_C 262 | |
#define TONE_D 294 | |
#define TONE_E 330 | |
#define TONE_F 349 | |
#define TONE_G 392 | |
#define TONE_A 440 | |
#define TONE_B 493 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <WiFi.h> | |
#include <SparkFunBME280.h> | |
#include <SparkFunCCS811.h> | |
#include "Adafruit_Si7021.h" | |
#include <MQTT.h> | |
#define CCS811_ADDR 0x5A | |
#define BMP280_ADDR 0x76 | |
#define SI2071_ADDR 0x40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include "MHZ19.h" | |
#include <SoftwareSerial.h> // <--- Remove if using HardwareSerial / ESP32 | |
#define RX_PIN 7 | |
#define TX_PIN 6 | |
#define BAUDRATE 9600 // Native to the sensor (do not change) | |
MHZ19 myMHZ19; | |
SoftwareSerial mySerial(RX_PIN, TX_PIN); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
const byte s8_co2[8] = {0xfe, 0x04, 0x00, 0x03, 0x00, 0x01, 0xd5, 0xc5}; | |
const byte s8_fwver[8] = {0xfe, 0x04, 0x00, 0x1c, 0x00, 0x01, 0xe4, 0x03}; | |
const byte s8_id_hi[8] = {0xfe, 0x04, 0x00, 0x1d, 0x00, 0x01, 0xb5, 0xc3}; | |
const byte s8_id_lo[8] = {0xfe, 0x04, 0x00, 0x1e, 0x00, 0x01, 0x45, 0xc3}; | |
SoftwareSerial swSer(9,8); // RX, TX | |
byte buf[10]; | |
uint16_t co2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <MQTT.h> | |
#include <Wire.h> | |
#include <ESP8266WiFi.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_BMP280.h> | |
#include "Adafruit_Si7021.h" | |
#define PUB_INTERVAL 30000 | |
unsigned long lastPublishMillis = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <U8g2lib.h> | |
#define PM10PIN 3 | |
#define PM25PIN 6 | |
#define ALARMSOUNDER 8 | |
int i; | |
unsigned long duration10; | |
unsigned long duration25; |
NewerOlder