15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| # This script work on any system using systemd as the init process. | |
| # To install (assuming root): | |
| # vim /etc/systemd/system/node-red.service | |
| # paste in the file contents | |
| # systemctl daemon-reload | |
| # systemctl enable node-red | |
| # service node-red start | |
| # service node-red status |
| function Decoder(bytes, port) { | |
| // Decode an uplink message from a buffer | |
| // (array) of bytes to an object of fields. | |
| var decoded = {}; | |
| // for Ursalink AM100/AM102 Payload Structure | |
| // From: https://resource.ursalink.com/document/am100_series_payload_structure.pdf | |
| for (i = 0; i < bytes.length;) { | |
| // BATTERY (%) | |
| if (bytes[i] == 0x01 && bytes[i+1] == 0x75) { |
15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| float aNumber = 999; | |
| void setup() { | |
| Serial.begin(115200); | |
| } | |
| void loop() { | |
| /* TIL: | |
| * the second argument in print is the number of decimal | |
| * places printed when passed a float/double |
| """ | |
| This module provides the application programming interface for the | |
| scoreboard application. | |
| """ | |
| from aniso8601 import parse_datetime | |
| from flask import jsonify, request | |
| from scoreboard import app, db | |
| from scoreboard.models import Game |
| //This code has the mode select commented out as well as the slider code | |
| //The result is a faster joysticks code. There's a delay function that we use to | |
| // slow the movemement of the arm down. | |
| // Idle is also set at 100 which probably needs adjusting to stop the servos timing out so quickly. | |
| #include <Servo.h> | |
| #include <SPI.h> | |
| #include <Adafruit_GFX.h> | |
| #include <Adafruit_PCD8544.h> |
I hereby claim:
To claim this, I am signing this object:
| # choose the leading octet: | |
| echo -en '\x06' | xxd -b | |
| # gives: | |
| # 0000000: 00000110 | |
| # where these ↑↑ digits must be 10 | |
| # i.e. an octet with the the hex representation x2, x6, xA or xE | |
| # then take the chosen octet and append a random number: | |
| echo -n "06:" ; openssl rand -hex 5 | sed 's/\(..\)/\1:/g; s/.$//' |
| echo '#!/bin/bash | |
| curl http://api.thingspeak.com/channels/1417/field/1/last.txt' > cl | |
| chmod +x cl | |
| ./cl |