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
/* TemperatureAndHumidity Class for DHT11 ==== */ | |
class TemperatureAndHumidity | |
{ | |
public: | |
TemperatureAndHumidity(int pin); | |
bool Read(float* temperature, float* humidity); | |
private: | |
int _pin; | |
void DHT11Init(int pin); | |
void DHT11Start(int 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
""" | |
`event` is; | |
{ | |
"transition_wating_sec": <sec:Integer>, | |
"thing_name": <thingName:String> | |
} | |
""" | |
import json | |
import logging |
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
""" | |
required ENVs; | |
- INCOMING_WEBHOOK: Slack's Incoming Webhook URL | |
- PARSON_(SINGLE|DOUBLE|LONG): JSONfy String | |
{"name": <Display name and Thing name:String>, | |
"slack_id": <Slack member ID (see profile):String>} | |
e.g.) {"name":"max","slack_id":"UC0RVEWBZ"} | |
""" | |
import json |
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
""" | |
INPUT: API Gateway | |
required ENVs; | |
- OUTGOING_TOKEN: Slack's Outgoing Webhook Token | |
""" | |
import json | |
import logging | |
logger = logging.getLogger() |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Call monitor</title> | |
<script src="//unpkg.com/vue/dist/vue.js"></script> | |
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.404.0/aws-sdk.min.js"></script> |
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
<!-- | |
AWS IoT's Thing Shadow access w/ Websocket over MQTT and Cognito | |
--> | |
<script type="text/javascript" src="https://sdk.amazonaws.com/js/aws-sdk-2.3.9.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/sha256.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha256.js"></script> | |
<script type="text/javascript" src="https://cdn.rawgit.com/ma2shita/2c5a4c29242dd5382b05ce941731fd41/raw/eb4bc16c02e7a72bbd0086e937050c258da09a20/sigv4utils.js"></script> | |
<script type="text/javascript" src="https://cdn.rawgit.com/ma2shita/63fb1dfd07753dc1ff67fe98132c0bc0/raw/ef50f3ec3276dd1c5dd90a3003e5105045b837e2/mqttws31.js"></script> | |
<script> |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>MQTT console for AWS IoT Core with MQTT over WebSocket</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.404.0/aws-sdk.min.js" integrity="sha256-5j5NcghceMlKBa2qXSGw6l24mOkiXOsdi9sB21pBips=" crossorigin="anonymous"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.2/mqttws31.min.js" integrity="sha256-UplsBBNj5zR16Nyo1bVLLVd0ndtLYs0A5c4WrbK/etU=" crossorigin="anonymous"></script> | |
<script>/* from https://docs.aws.amazon.com/ja_jp/iot/latest/developerguide/protocols.html */ | |
/** |
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 <string.h> | |
#define TINY_GSM_MODEM_UBLOX | |
#include <TinyGsmClient.h> | |
TinyGsm modem(Serial2); /* Serial2 is Modem of 3G Module */ | |
TinyGsmClient ctx(modem); | |
void modem_enabler(); | |
void print_bottom_menu(); |
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
#!/usr/bin/env python | |
# fork from https://github.com/Nilhcem/esp32-cloud-iot-core-k8s/blob/master/04-generate-jwt/main.py | |
from optparse import OptionParser | |
import datetime | |
import jwt | |
import sys | |
def create_jwt(project_id, private_key_file, algorithm): |
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
#!/usr/bin/env python3 | |
import binascii | |
from bluepy.btle import Peripheral | |
class SwitchBot: | |
def __init__(self, mac_address): | |
self.p = Peripheral(mac_address, "random") | |
hand_service = self.p.getServiceByUUID("cba20d00-224d-11e6-9fb8-0002a5d5c51b") | |
self.hand = hand_service.getCharacteristics("cba20002-224d-11e6-9fb8-0002a5d5c51b")[0] |