Skip to content

Instantly share code, notes, and snippets.

Kohei MATSUSHITA ma2shita

Block or report user

Report or block ma2shita

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ma2shita
ma2shita / m5stack_rainradar_with_soracom_beam.ino
Last active Aug 23, 2019
RainRadar by YOLP for M5Stack with SORACOM Beam
View m5stack_rainradar_with_soracom_beam.ino
/*
* Copyright (c) 2019 Kohei "Max" MATSUSHITA
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <M5Stack.h>
#define CONSOLE Serial
#define MODEM Serial2 /* Serial2 is Modem of 3G Module */
#include <string.h>
@ma2shita
ma2shita / m5stack_rainradar.ino
Last active Aug 26, 2019
RainRadar by YOLP for M5Stack
View m5stack_rainradar.ino
/*
* Copyright (c) 2019 Kohei "Max" MATSUSHITA
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <M5Stack.h>
#define CONSOLE Serial
#define MODEM Serial2 /* Serial2 is Modem of 3G Module */
#include <string.h>
@ma2shita
ma2shita / m5stack_3gextboard_worldclock.ino
Last active Aug 20, 2019
World Clock for M5Stack with 3G Ext. board
View m5stack_3gextboard_worldclock.ino
/*
* Copyright (c) 2019 Kohei "Max" MATSUSHITA
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <M5Stack.h>
#define TINY_GSM_MODEM_UBLOX
#include <TinyGsmClient.h>
@ma2shita
ma2shita / switchbot.py
Last active Aug 12, 2019
Operation for SwitchBot (using Pyhton3)
View switchbot.py
#!/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]
@ma2shita
ma2shita / generate_jwt_for_gcp_iot_core.py
Created Jul 25, 2019
Generate JWT for Google IoT Core's Client
View generate_jwt_for_gcp_iot_core.py
#!/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):
@ma2shita
ma2shita / m5stack_generic_console_to_modem.ino
Created Jul 10, 2019
m5stack_generic_console_to_modem.ino
View m5stack_generic_console_to_modem.ino
#include <M5Stack.h>
#define CONSOLE Serial
#define MODEM Serial2
#define TINY_GSM_DEBUG CONSOLE
#define TINY_GSM_MODEM_UBLOX
#include <TinyGsmClient.h>
@ma2shita
ma2shita / m5stack_informater_weather.ino
Last active Jul 1, 2019
Weather informater for M5Stack + 3G Ext. board
View m5stack_informater_weather.ino
#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();
View mqtt_console_for_awsiotcore_with_mqtt_over_wss.html
<!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 */
/**
@ma2shita
ma2shita / awsiotcore-deviceshadow_via_soracom-beam.ino
Last active Jan 2, 2019
Using Device shadow of AWS IoT Core via SORACOM Beam
View awsiotcore-deviceshadow_via_soracom-beam.ino
/*
* Copyright (c) 2019 Kohei "Max" MATSUSHITA
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <string.h>
#include <stdio.h>
#include <WioLTEforArduino.h>
WioLTE Wio;
#include <WioLTEClient.h>
@ma2shita
ma2shita / call_monitor.html
Last active Feb 20, 2019
See: https://qiita.com/ma2shita/items/8f1b4b12faa99dd17063 | Monitoring ThingShadow in AWS IoT Core using Websocket
View call_monitor.html
<!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>
You can’t perform that action at this time.