sshpass -p yourpassword ssh debian@beaglebone.local "echo 0.5 > /home/debian/pulse_on"
sshpass -p yourpassword ssh debian@beaglebone.local "echo 2 > /home/debian/pulse_off"
import socket, struct, time, sys
ipAddr = sys.argv[1]
NUM_PIXELS = 16
pixels = bytes([255, 0, 0] * NUM_PIXELS) # RED
header = struct.pack('>BBH', 0, 0, len(pixels))
packet = header + pixels
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(packet, (ipAddr, 7891))
time.sleep(0.05)
s.sendto(packet, (ipAddr, 7891))
import socket, struct, time, math, sys
ipAddr = sys.argv[1]
NUM_PIXELS = 16
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Prime the buffer
pixels = bytes([255, 0, 0] * NUM_PIXELS)
header = struct.pack('>BBH', 0, 0, len(pixels))
s.sendto(header + pixels, (ipAddr, 7891))
time.sleep(0.05)
# Now update continuously
i = 0
while True:
r = int((math.sin(i * 0.05) + 1) * 127)
pixels = bytes([r, 0, 0] * NUM_PIXELS)
header = struct.pack('>BBH', 0, 0, len(pixels))
s.sendto(header + pixels, (ipAddr, 7891))
time.sleep(0.033)
i += 1
BBB issues
#!/bin/bash
process="jackd"
cpuUsage=$(top -bn2 -p $(pgrep $process) | grep $process | tail -n 1 | awk {'print $9;'} | cut -f1 -d'.')
# echo $cpuUsage
if [ "$cpuUsage" -gt "80" ]; then
echo "PUTPASSWORDHEREYESIKNOWTHISISNOTSECURE" | sudo -S reboot
fi