Spyke

Posts

I made: an automatic music player

My spouse wanted music to come on automatically in our bathrooms, so I made the Apollo Light - a light-activated music player. I'm pretty proud of it, and my wife loves it. They'll end up in every bathroom we have.

I made it possible to easily reverse the light activation so it can serve as a white noise machine at bedtime.

I made: an automatic music playerhttps://makerworld.com/en/models/1937616-apollo-light-light-activated-music-player#profileId-2080695Open linkView original on infosec.pub

4b with multiple Zero over USB ethernet?

I've got a Zero set up with usb0 as g_ether and a static IP address:

usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.14.0.15  netmask 255.255.255.0  broadcast 10.14.0.255
        ether 7e:24:7d:cc:68:7c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I have the OTG port connected to one of the four USB ports on a 4b. I'm not sure what the next steps are to get the actual connectivity to function, though. I've seen posts saying that gadget mode is only supported on the USB-C port - does that only mean for using the 4b as a peripheral, or does that mean for any connectivity, even if it's the host?

View original on infosec.pub

CircuitPython - Trying to set pin value

New to CircuitPython, this feels like it should work according to the docs but it prints six Falses. Any ideas?

#!/usr/bin/env python
import board
import digitalio
import time

class body_controller:

  def __init__(self):
    SWDIO = board.D5
    self._reset_pin = digitalio.DigitalInOut(SWDIO)
    print(self._reset_pin.value)
    self._reset_pin.switch_to_output(True)
    print(self._reset_pin.value)

  def turn_on(self):
    print(self._reset_pin.value)
    self._reset_pin.value = False
    print(self._reset_pin.value)
    time.sleep(1)
    print(self._reset_pin.value)
    self._reset_pin.value = True
    print(self._reset_pin.value)

body = body_controller()
time.sleep(1)
body.turn_on()
time.sleep(1)
View original on infosec.pub

vlc.py -- setting the time in a song sets the song stuttering and it doesn't really recover

This happens if I use set_time or set_position. Is this typical, or am I just not doing it right?

This is on a Pi Zero 2 W, so not the most powerful, but should be able to handle this.

These are the relevant bits of how I'm setting up the player:

    self._vlc = vlc.Instance()
    self._player = self._vlc.media_player_new()
    self._list_player = self._vlc.media_list_player_new()
    self._list_player.set_media_player(self._player)

    playlist = self._vlc.media_list_new()
    for index in self._play_order:
      playlist.add_media(self._vlc.media_new_path(self._songs[index]))

    self._list_player.stop()
    self._list_player.set_media_list(playlist)
    self._list_player.play()

And trying to seek is just this:

    self._player.set_time(_s_to_ms(seconds))

Any ideas would be greatly appreciated!

View original on infosec.pub