Skip to content

Instantly share code, notes, and snippets.

View mikebranstein's full-sized avatar

Mike Branstein mikebranstein

View GitHub Profile
@mikebranstein
mikebranstein / debug.log
Last active February 5, 2021 15:30
Terraform AzureRM - Storage Account Network Rules Virtual Network Subnet Ids not detecting changes - DEBUG LOG
2021/02/05 10:29:14 [INFO] Terraform version: 0.14.6
2021/02/05 10:29:14 [INFO] Go runtime version: go1.15.6
2021/02/05 10:29:14 [INFO] CLI args: []string{"C:\\Users\\mikeb\\Desktop\\temp\\terraform\\stable\\terraform.exe", "plan"}
2021/02/05 10:29:14 [DEBUG] Attempting to open CLI config file: C:\Users\mikeb\AppData\Roaming\terraform.rc
2021/02/05 10:29:14 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/02/05 10:29:14 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/02/05 10:29:14 [DEBUG] ignoring non-existing provider search directory C:\Users\mikeb\AppData\Roaming\terraform.d\plugins
2021/02/05 10:29:14 [DEBUG] ignoring non-existing provider search directory C:\Users\mikeb\AppData\Roaming\HashiCorp\Terraform\plugins
2021/02/05 10:29:14 [INFO] CLI command args: []string{"plan"}
2021/02/05 10:29:14 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
@mikebranstein
mikebranstein / terraform-output.md
Created February 5, 2021 15:24
Terraform AzureRM - Storage Account Network Rules Virtual Network Subnet Ids not detecting changes

Getting Started

  1. Unzip example.zip from https://www.dropbox.com/s/2yd3d8d642cotc0/example.zip?dl=0
  2. Update main.tf file to include tenant_id and subscription_id values for an Azure subscription
  3. az login --tenant <tenant_id>
  4. terraform init
  5. terraform apply, which creates the base of the example resources:
  • example-rg resource group
  • example-vnet virtual network
  • subnet1 subnet (with Storage and Key Vault service endpoints)
  • exampleXXXXXXXXX storage account
void WeatherService::init(bool debugMode) {
// previous init code goes here
//Initialize the I2C sensors and ping them
_sensor.begin();
}
#include "lib/SparkWeatherShield/SparkFun_Photon_Weather_Shield_Library.h" // Include the SparkFun MPL3115A2 library
Weather _sensor;
#include "lib/SparkWeatherShield/SparkFun_Photon_Weather_Shield_Library.h" // Include the SparkFun MPL3115A2 library
char* WeatherService::getWeatherData() {
serialPrintln();
// Measure Relative Humidity from the HTU21D or Si7021
float humidity = _sensor.getRH();
// Measure Temperature from the HTU21D or Si7021
float tempf = _sensor.getTempF();
//Measure the Barometer temperature in F from the MPL3115A2
void loop() {
char* json = weatherService.getWeatherData();
Particle.publish("w", json, PRIVATE);
System.sleep(weatherService.getRainGaugeSignalPin(), FALLING, MINUTES_TO_SLEEP);
}
@mikebranstein
mikebranstein / weather-monitor-init.c
Created September 19, 2017 15:20
Weather monitor init code
void WeatherService::init(bool debugMode) {
_debugMode = debugMode;
if (debugMode) {
Serial.begin(9600); // open serial over USB at 9600 baud
// Make sure your Serial Terminal app is closed before powering your device
// Now open your Serial Terminal, and hit any key to continue!
Serial.println("Press any key to begin");
@mikebranstein
mikebranstein / weather-monitor-app.c
Created September 19, 2017 15:07
Main weather monitor app
#include "weather-service.h"
#define MINUTES_TO_SLEEP (15*60)
WeatherService weatherService;
// setup() runs once, when the device is first turned on.
void setup() {
// initialize the weather service, true = debug, false = production
weatherService.init(false);
void setup() {
// configuration code goes here
}
void loop() {
// this code runs continually in a loop
// add your execution logic here
// the publish() method sends a event to the Particle cloud
// the first parameter is the event name, second is the event data