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
/* | |
* send_multiple_sensor_data_with_soracom.ino | |
* Multiple sensor value send to Cloud via Unified Endpoint of SORACOM | |
* | |
* Copyright (c) 2020 SORACOM, INC. | |
* This software is released under the MIT License. | |
* http://opensource.org/licenses/mit-license.php | |
*/ | |
#define CONSOLE Serial |
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 <WioLTEforArduino.h> | |
#include <stdio.h> | |
#define INTERVAL (60000) | |
#define RECEIVE_TIMEOUT (10000) | |
// uncomment following line to use Temperature & Humidity sensor | |
// #define SENSOR_PIN (WIOLTE_D38) | |
WioLTE Wio; |
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
#!/bin/bash | |
# PIN assign | |
BUTTON=2 | |
LAN=3 | |
INTERNET=4 | |
NG=14 | |
OK=15 | |
# Command for button | |
PUSH="sudo reboot" |
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
#!/bin/bash | |
# install required packages | |
apt-get install -y eject wvdial | |
# add wvdial config | |
cat << EOF > /etc/wvdial.conf | |
[Dialer Defaults] | |
Init1 = ATZ | |
Init2 = AT+CFUN=1 | |
Init3 = AT+CGDCONT=1,"IP","soracom.io" |
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
#!/bin/bash | |
json=$( | |
awk '{printf "{\"temperature\":%3.1f,", $1/1000}' /sys/class/thermal/thermal_zone0/temp | |
top -b -n 2 | grep %Cpu | tail -1 |a awk '{printf "\"CPU\":%.1f}\n", $2+$4+$6+$10+$12+$14}' | |
) | |
echo $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
#!/usr/bin/env ruby | |
require 'soracom' | |
require 'json' | |
if ARGV.length < 3 | |
puts <<EOS | |
usage: #{$PROGRAM_NAME}" key.pem cert.pem ca.pem [ group-id ] | |
If 'group-id' is provided, this program will set Beam config to access AWS IoT. | |
If 'group-id' is not provided, this program will generate JSON to use with CLI. |
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
#!/bin/bash | |
init_fs01bu() | |
{ | |
usb_modeswitch -t <<EOF | |
DefaultVendor= 0x$1 | |
DefaultProduct= 0x$2 | |
TargetVendor= 0x$3 | |
TargetProduct= 0x$4 | |
MessageEndpoint= not set | |
MessageContent="55534243123456780000000080000606f50402527000000000000000000000" |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"period": { | |
"Default": 3300, | |
"Description": "SQS message lifetime. SNS events will be kicked every (300 + this value) seconds", | |
"Type": "Number" | |
} | |
}, | |
"Resources": { |
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
console.log 'lambda2cw Started' | |
aws = require 'aws-sdk' | |
s3 = new aws.S3 | |
apiVersion: '2006-03-01' | |
cw = new aws.CloudWatch | |
apiVersion: '2010-08-01' | |
putMetrics = (metrics,namespace,callback) -> | |
metricdata=metrics.splice(0,20) # Max 20 metric data per request |
NewerOlder