Skip to content
Snippets Groups Projects
Commit 8737a8ab authored by Aymeric Bernard's avatar Aymeric Bernard
Browse files

Cleaned up some old files, added the nfc-poll-wrapper dummy

parent 3f65008c
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,6 @@ build/ ...@@ -7,7 +7,6 @@ build/
server/config.js server/config.js
front/src/config.js front/src/config.js
scripts/nfc-poll-wrapper-dummy.sh
# *.pub # *.pub
# *.key # *.key
#!/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"
#!/bin/bash
while :
do
sleep 5
echo "12345678901234"
#echo "11ff11 0.2" > /dev/rgb_pipe
sleep 30
done
#!/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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment