This file contains hidden or 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 <ArduinoModbus.h> | |
| #include <WiFiNINA.h> | |
| #include <MQTT.h> | |
| // WiFi credentials. | |
| const char ssid[] = "wifi-name"; | |
| const char pass[] = "wifi-password"; | |
| // MQTT credentials. | |
| const char* MQTT_CLIENT_ID = "mqtt-client-id"; |
This file contains hidden or 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 <ArduinoModbus.h> | |
| // How often (in milliseconds) the sensors will be read. | |
| const unsigned long REPORT_INTERVAL = 1000; | |
| void setup() { | |
| Serial.begin(9600); | |
| while(!Serial); | |
| if (!ModbusRTUClient.begin(9600)) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
| "width": {{block.width}}, | |
| "height": {{block.height}}, | |
| "autosize": { | |
| "type": "fit", | |
| "contains": "padding" | |
| }, | |
| "config": { | |
| "axis": { |
This file contains hidden or 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
| /** | |
| Copyright (c) 2016 Losant IoT. All rights reserved. | |
| https://www.losant.com | |
| */ | |
| #include <WiFiClientSecure.h> | |
| #include <Losant.h> | |
| // WiFi credentials. | |
| const char* WIFI_SSID = "WIFI_SSID"; |
This file contains hidden or 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
| import machine | |
| from network import Sigfox | |
| import socket | |
| import struct | |
| import time | |
| # init Sigfox for RCZ2 (USA, Mexico, Brazil) | |
| # other zones: | |
| # RCZ1: Europe, Oman, South Africa | |
| # RCZ2: USA, Mexico, Brazil |
This file contains hidden or 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
| // Import libraries | |
| #require "JSONEncoder.class.nut:2.0.0" | |
| // Log the URLs we need | |
| server.log("Turn LED On: " + http.agenturl() + "?led=1"); | |
| server.log("Turn LED Off: " + http.agenturl() + "?led=0"); | |
| function sendSensorDataToLosant(data) { | |
| local losantWebhookURL = "LOSANT_WEBHOOK_URL" |
This file contains hidden or 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
| #require "HTS221.device.lib.nut:2.0.1" | |
| #require "LPS22HB.class.nut:1.0.0" | |
| #require "WS2812.class.nut:3.0.0" | |
| // Define constants | |
| const SLEEP_TIME = 15; | |
| // Declare Global Variables | |
| tempSensor <- null; |