projects:commerce_st

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:commerce_st [2025/03/05 14:18] – created John Harrisonprojects:commerce_st [2026/06/29 22:04] (current) John Harrison
Line 1: Line 1:
 ===== Electric Chameleons ===== ===== Electric Chameleons =====
   * [[https://huggingface.co/spaces/r3gm/Audio_separator|This audio separator]] works really well separating environmental noise and ported over OK to a local Jetson machine   * [[https://huggingface.co/spaces/r3gm/Audio_separator|This audio separator]] works really well separating environmental noise and ported over OK to a local Jetson machine
 +    * licensed under [[https://opensource.org/license/mit|MIT license]]
 +
 +==== Controlling Beaglebone Black ====
 +  * change parameters for stepper motor (read by ''pinPulse.sh'')
 +<code bash>
 +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"
 +</code>
 +  * LED strip test
 +<code python>
 +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))
 +</code>
 +  * led strip fade test
 +<code python>
 +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
 +</code>
 +==== BBB config ====
 +  * change # of LEDs in strip by editing ''/etc/ledscape-config.json''
 +  * flash sdcard to emmc
 +    * optional: make sure the sdcard is healthy. When **not** mounted (example): ''sudo fsck.ext4 -f /dev/sda1''
 +    * boot BB from sdcard then: ''sudo /opt/scripts/tools/eMMC/bbb-eMMC-flasher-eewiki-ext4.sh''
 +
 +=== BBB issues ===
 +  * jack is failing overnight. There was a solution built into the whisphering woodlands project I think?
 +    * the solution is to set up a cronjob that runs every 5 minutes and reboots the BB if jack fails: ''restartIfJackIsJacked.sh''
 +<code bash>
 +#!/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
 +</code>
  • projects/commerce_st.1741184313.txt.gz
  • Last modified: 2025/03/05 14:18
  • by John Harrison