Skip to content

Instantly share code, notes, and snippets.

View robertsLando's full-sized avatar
🤓
Coding

Daniel Lando robertsLando

🤓
Coding
  • Innovation System
  • Bassano del Grappa (Italy)
  • 22:29 (UTC +01:00)
  • X @robertsLando
View GitHub Profile
@robertsLando
robertsLando / package.sh
Last active August 26, 2018 10:40
sh script to create a nodejs application executable using pkg https://www.npmjs.com/package/pkg and automatically including .node files and zip with all application files
#!/bin/bash
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
@robertsLando
robertsLando / influx_helper.js
Last active February 23, 2020 19:07
Influx DB (v 1.5.0+) Backup/Restore, Retention Policy and APIs helper
var Influx = require('influx');
var QL = require('influx-ql'); //influx query builder
var logger = require('../config/logger.js'); //winston logger
var configDB = require('../config/database.js'); //database constants configuration file
var cmd = require('node-cmd'); //to execute commands
var backup_path = __dirname + configDB.influx_backup; //path to temporary folder used to store backups files
// UTILS FUNCTIONS
function dateToNano(date){
@robertsLando
robertsLando / README.md
Last active May 6, 2023 08:58
Z-Wave Control Panel with node-red-dashboard
@robertsLando
robertsLando / README.md
Last active November 3, 2017 09:12
Fibocom G510 Dashboard and Localization with OpenCellID and Google APIs

General

This Flow allows users to retrive informations from their G510 GSM/GPRS Module like: signal strength, Operator name, MCC MNC CellID and LAC (for localization purposes), IMEI code aND other manifacturer specific codes.

node-red-node-serialport is used to send AT comands to the ttyAMA0 interface and read the output response from the module. More info about AT commands input/output formats can be found

@robertsLando
robertsLando / README.md
Last active June 16, 2022 10:12
Simple Modscan like UI for Modbus testing

This flow creates a Tab "Modscan" in Node-Red UI that allows to:

  • Manual SERIAL and TCP connection (NEW FEATURE)
  • Read Modscan Registers And Coils in real time (FC3 and FC1)
  • Convert 2*16bit registers in 32 bit
  • Convert values in HEX rappresentation
  • Convert values in Float IEEE-754 rappresentation
  • Write Registers and Coils (FC5 FC6)
  • Write Hex values (The hex value will be converted to int than sent to Modbus Write Node)
@robertsLando
robertsLando / README.md
Last active March 17, 2023 12:35
Raspberry PI eth0 static IP network configuration via Dashboard

This flows allows users to manually change and enable the static IP configuration of the Raspberry PI.

This flow reads configuration in /etc/dhcpcd.conf file and uses sed commands to enable static ip on eth0 interface end manually set the new static ip parameters.

If you have never edited the /etc/dhcpcd.conf file this flow will work without any problem, it expect to find something like this

#interface eth0
#static ip_address=192.168.1.xx/24
#static routers=192.168.1.xx
@robertsLando
robertsLando / README.md
Last active September 27, 2021 09:09
Temperature/ON-OFF Week Scheduler UI-Template Node-Red Dashboard

This allows users to set up a 24h scheduler for each day of the week in a quick and easy way.

It is a customization of Peter Scargill Thermostat Weekend so all credits goes to him.

In the Comment node you can find instructions on how to create more schedulers in the same UI, just need to copy/paste the flow of a single scheduler and find/replace the name of variables listed in the Comment node.

UI Preview

alt text

@robertsLando
robertsLando / README.md
Last active February 20, 2024 12:11
Security Pin Dialog UI Template for Node-Red-Dashboard

Custom UI-template (with example usage) that shows a Dialog that asks the user to insert a 4 digits PIN.

This flow can be used as middleware to authorize actions.

Allowed PINS are saved in an array of stings in the node "verify_pin", this can be customized by saving authorized pins in a file or others safer ways.

The ui-group that contains the dialog template must have the property "Display group name" unchecked; it will not be visible in dashboard so do not place anything else in this ui-group.

UI Preview