Skip to content

Instantly share code, notes, and snippets.

View ma2shita's full-sized avatar

Kohei MATSUSHITA ma2shita

View GitHub Profile
@ma2shita
ma2shita / Grove_temp_humd_uv_LCD.ino
Last active June 21, 2017 00:48
Sensing temperature & humidity & UV using Grove and sending with LoRaWAN
/* ** Hardware setup **
* Arduino UNO R3 + LoRaWAN Shield + Grove Shield
* LCD => I2C
* Temp&Humd => I2C
* UV => A0
* Button => D2 (optional) => Not use LoRaWAN when pushed button in bootup (default is used LoRaWAN)
*/
/* ** Software setup **
* Grove Temper&Humd : https://github.com/Seeed-Studio/Grove_Temper_Humidity_TH02
* Grove LCD : https://github.com/Seeed-Studio/Grove_LCD_RGB_Backlight
@ma2shita
ma2shita / DS18B20_LoRaWAN.ino
Last active July 15, 2017 07:02
1-wire temperture "DS18B20" + LoRaWAN Shield
/* ** Hardware setup **
* Arduino UNO R3 + LoRaWAN Shield + DS18B20
*
* VCC(red) ------+---- 5V
* |
* DS18B20 10K Arduino
* |
* BUS(yellow) ---+---- 6
* GND(black) --------- GND
*/
@ma2shita
ma2shita / WioLTE_MFT2017.ino
Created August 4, 2017 01:20
Wio Tracker LTE and SORACOM Harvest w/ Grove touch sensor
/* LED status
* bootup = Purple
* connect sucessful = Green
* Sensor Open = White
* Sensor Close = Blue
*/
/*
* D38: "Grove Touch sensor" or "Magnetic door Switch w/ Grove connector made in max"
*/
/*
Needs ENVs.
- AWSIOT_ENDPOINT (You see Management Console in AWS IoT setting)
- AWSIOT_TOPIC_PREFIX (any you set)
*/
// code from https://github.com/sigfox/npm-sensit
const SensitMsg = function(sigfoxFrame){
this.frame = Number(parseInt(sigfoxFrame, 16));
this.frameStr = sigfoxFrame;
@ma2shita
ma2shita / example_for_unashieldv2s_w_soracom_harvest.ino
Last active October 9, 2017 09:29
Example for "Sigfox Shield for Arduino (UnaShield V2S)" with SORACOM Harvest
/* Get temperature from on-board sensor, sending SORACOM Harvest via Sigfox */
#include "SIGFOX.h"
static UnaShieldV2S transceiver(COUNTRY_JP, false, "NOTUSED", true); /* ref: https://unabiz.github.io/unashield/ */
void setup() {
Serial.begin(9600);
if (!transceiver.begin()) stop(F("Unable to init SIGFOX module, may be missing"));
}
void loop() {
@ma2shita
ma2shita / WioLTE-J_EC21-J_AT_debug.ino
Last active January 29, 2021 08:07
AT debug console for EC21-J on WioLTE
/*
Working exapmle on Console;
```
>> Waiting for AT command
+CPIN: READY
+QUSIM: 1
@ma2shita
ma2shita / dmsg_of_ms2131i-8.txt
Created November 7, 2017 03:29
dmsg of Huawei MS2131i-8 on Raspbian Stretch (linux 4.9)
usb 1-1.2: new high-speed USB device number 4 using dwc_otg
usb 1-1.2: New USB device found, idVendor=12d1, idProduct=14fe
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2: Product: HUAWEI Mobile
usb 1-1.2: Manufacturer: HUAWEI
usb 1-1.2: SerialNumber: FFFFFFFFFFFFFFFF
usb-storage 1-1.2:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1.2:1.0
usb 1-1.2: USB disconnect, device number 4
usb 1-1.2: new high-speed USB device number 5 using dwc_otg
@ma2shita
ma2shita / wio-lte-sent-to-both-harvest-and-funnel.ino
Created December 4, 2017 05:13
wio-lte-sent-to-both-harvest-and-funnel
/* Send to both SORACOM Harvest and SORACOM Funnel */
#include <WioLTEforArduino.h>
#include <stdio.h>
#define INTERVAL (10000)
#define SENSOR_PIN (WIOLTE_D38)
WioLTE Wio;
@ma2shita
ma2shita / wio-lte-define-by-ota.ino
Created December 31, 2017 14:57
Define setting in Wio LTE by OTA (Tag of SORACOM Air SIM)
/*
Tag on SORACOM Air SIM
key=_conf
value={"working_mode":"uptime","loop_interval":5000,"send_cloud":true,"endpoint_host":"harvest.soracom.io","endpoint_port":8514}
(alt)value={"working_mode":"led","loop_interval":1000}
*/
#include <stdio.h>
#include <string.h>
#include <WioLTEforArduino.h>
WioLTE Wio;
@ma2shita
ma2shita / WioLTE_emit_IMEI_to_SORACOM_Harvest.ino
Created January 10, 2018 07:11
WioLTE emit IMEI to SORACOM Harvest
#include <stdio.h>
#include <WioLTEforArduino.h>
WioLTE Wio;
#define CLEAR 0
#define GRAY 90
#define RED 91
#define GREEN 92
#define YELLOW 93
#define BLUE 94