diff --git a/.gitignore b/.gitignore index 9055c5a38dc53cc269bcc45cbe7c3632ad433bcd..0fde43f6bd849f8ad84623d502dbf21cdbc6570a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ build/ server/config.js front/src/config.js -scripts/nfc-poll-wrapper-dummy.sh # *.pub # *.key diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100644 index 5862375797056614aa246aa80a656f003991aae8..0000000000000000000000000000000000000000 --- a/scripts/install.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# WORK IN PROGRESS, /tmp/ stuff is to avoid breaking stuff - -CURDIR=`pwd` - -ln -s "$CURDIR/.screenrc" /tmp/ # /home/hermod -ln -s "$CURDIR/.vimrc" /tmp/ # /home/hermod - -sudo cp "$CURDIR/waitForNetwork" /tmp/ # /root/scripts -sudo cp "$CURDIR/startup-telegram-message" /tmp/ # /root/scripts - -# Folder containing root scripts that can be used with sudo without password -sudo mkdir /hermod_bin -sudo cp "$CURDIR/statusRGB.py" /hermod_bin - -echo "Put in root crontab (sudo crontab -e):" -echo "@reboot /root/scripts/waitForNetwork && /root/scripts/startup-telegram-message" -echo "" -echo "Edit /root/scripts/startup-telegram-message to add your token and chat id" -echo "" -echo "Add this at the end of /etc/sudoers (sudo visudo):" -echo "hermod ALL=(ALL) NOPASSWD: /hermod_bin/statusRGB.py" diff --git a/scripts/nfc-poll-wrapper-dummy.sh b/scripts/nfc-poll-wrapper-dummy.sh new file mode 100755 index 0000000000000000000000000000000000000000..a4a8fc06486040a3d78e85d83cfcadf79d9bced9 --- /dev/null +++ b/scripts/nfc-poll-wrapper-dummy.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +while : +do + sleep 5 + echo "12345678901234" + #echo "11ff11 0.2" > /dev/rgb_pipe + sleep 30 +done diff --git a/scripts/statusRGB.py b/scripts/statusRGB.py deleted file mode 100755 index 676255e44b1201a83c3209580438a6fd03dc9366..0000000000000000000000000000000000000000 --- a/scripts/statusRGB.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import sys -import time -import argparse - -from neopixel import * - - -# LED strip configuration: -LED_COUNT = 1 # Number of LED pixels. -LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). -#LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spidev0.0). -LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) -LED_DMA = 10 # DMA channel to use for generating signal (try 10) -LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest -LED_INVERT = False # True to invert the signal (when using NPN transistor level shift) -LED_CHANNEL = 0 # set to '1' for GPIOs 13, 19, 41, 45 or 53 -LED_STRIP = ws.WS2811_STRIP_GRB # Strip type and colour ordering - - -def opt_parse(): - parser = argparse.ArgumentParser() - parser.add_argument('color', help='The color to display') - parser.add_argument('-t', '--time', type=float, help='Display the color during this amount of seconds') - return parser.parse_args() - - -# Main program logic follows: -if __name__ == '__main__': - # Process arguments - args = opt_parse() - - hex_color = args.color - hex_color = hex_color.lstrip('#') - if len(hex_color) == 3: - hex_color = '{0}{0}{1}{1}{2}{2}'.format(*hex_color) - if len(hex_color) != 6: - raise ValueError('Please use 6 hex characters color format') - - (r, g, b) = (int(x, 16) for x in [hex_color[i:i+2] for i in (0, 2, 4)]) - - # Create NeoPixel object with appropriate configuration. - strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL, LED_STRIP) - # Intialize the library (must be called once before other functions). - strip.begin() - strip.setPixelColorRGB(0, r, g, b) - strip.show() - if isinstance(args.time, float) and args.time > 0: - time.sleep(args.time) - strip.setPixelColorRGB(0, 0, 0, 0) - strip.show()