this is an expansive series of projects all spring from the same code base. what all have in common is the idea of a self-contained sound-producing box that can also communicate via Flock or Peep protocols. some have battery and solar power and power management for use in remote, unattended installations. at the moment none have sensors but environmentally-triggered flocking behavior is the goal. the solar devices will also get an LED and some sensor.
code for each project is below, which also require the SR libraries to compile.
all of these talk to the/a flockBase device, usually attached to a desktop Processing application that logs and visually displays flock status. flockBase can also turn all birds on or off.
the bad batch caused me to make flockPinger, a real nRF24L01+ module test machine which doubles as a radio as well; shown below.
these have LiPo battery, solar panel, solar charge controller. they are intended for unattanded operation, affixed to a light pole or equiv, [not commandable from the ground], and play during daylight/dusk hours only. "dusk" is detected by solar panel output, rather than a clock. code is here. images are here.
these are 9VDC wall-wart powered, no battery or solar. LED and pushbutton. code is here. these were the original impetus for this project, which i proposed based upon a previous workup of the radio protocols. these became the platform for Flock and Peep protocols (the latter aimed very specfically at super-low-power requirements of solar power).
there were two prototypes; the first one has the red proto shield and the chopped up box. it later got cannibalized for the soundcard. the second prototype became Brett and Heather's wedding gift (it probably needs code update!). some of the in-construction pics show radios with rubber-ducky antennae attached; that was the goal, but the whole batch turned out to be fake chips (i mean wtf, seriously) and so i replaced them all with integral-antenna modules, which are just fine anyway.
all soundboxen have a status LED that indicates global state. the blink sequence is two seconds long, and the number of blinks in that time have the following meanings:
|2||low battery (therefore many functions suspended)|
|3||after dusk, eg. solar output below duskLimit|
|4||currently making sound|
|5||player or radio hardware problem|
|8||mounted as USB disk|
all sound boxen support the following commands (though not all do anything useful, eg. solar commands for the non-solar birds), delivered via USB (the serial monitor) or radio or stored in EEPROM.
|A||transmit player state|
|B||autoplay 1 enable 0 disable|
|D||autoplay program: 0 play only song 0, 1 play random, 2 play sequential|
|E||autoplay schedule variation, deciseconds|
|F||abort playing now, 1 play next (autoplay) or again (single play)|
|G||set volume 0..17|
|H||play song n now|
|I||autoplay interval, deciseconds|
|J||1 power off player between songs (incurs 1 sec delay each play), 0 leave power on|
|K||autoplay silence gap between songs (deciseconds)|
|L||load settings from EEPROM|
|M||reset player (debug)|
|N||stop player (debug)|
|P||radio protocol, 0 Flock, 1 Peep|
|Q||battery-low lower limit, millivolts|
|R||power report interval, deciseconds|
|S||save all settings to EEPROM|
|T||solar panel dusk limit, millivolts|
|W||battery-low upper limit, millivolts|
|Y||load default settings (USB only)|
all sound boxen also support the following commands, sent via USB (eg. manually typed) or saved in EEPROM only. actually some of these may be changed via radio message but you ought to have prior clue before attempting.
|f||set fixed channel (requires k)|
|g||select next channel|
|h||set minimum channel (1)|
|i||set maximum channel (126)|
|j||enable dynamic channel selection (default)|
|j||disable dynamic channel selection|
|l||set radio data rate (0, 1, 2)|
|m||set PA level (0, 1, 2, 3)|
|n||set Rx Ack Request interval, seconds|
|o||set Rx Ack Timeout interval, seconds|
|p||set Lost Ack Threshold, count|
|q||set Rx promiscuous packet mode (debug)|
|r||set Peep connect attempt time, deciseconds|
|s||set Peep connect up time, deciseconds|
|x||set identity (USB only)|