-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Pipe Kit as an autostart.sh file on a USB Drive #27
Comments
Here's an example that connects to wifi...
|
Other thoughts...
Lastly, this is a lot to do. We all need to be thinking MVP here. |
@treehouse-su What are your thoughts on the difficulty level of getting autorun to work on Debian? |
How about an autorunonce.sh
autorun.sh
|
I suppose we don't need an autorunonce.sh. We could start with |
Here is an example of doing an install before making autorun.sh a pipe script. @treehouse-su This utilizes your prirate-sh script and then does the necessary reboot. This also has blink commands to indicate status to the outside which is a special frill. autorun.sh
run.sh
|
Jack-in-a-Catapult approach... An autostart.sh file that downloads drivers, installs them, deletes itself, and then rewrites itself as pipe commands. # Indicate we are installing.
blink red
# Get the drivers and install them
mkdir drivers
wget --directory-prefix drivers https://github.com/openpipekit/opk-phant-cli/archive/0.3.0.zip
unzip drivers/0.3.0.zip
rm drivers/0.3.0.zip
./drivers/opk-phant-cli-0.3.0/install
wget --directory-prefix drivers https://github.com/openpipekit/opk-temper1-cli/archive/0.5.0.zip
unzip drivers/0.5.0.zip
rm drivers/0.5.0.zip
./drivers/opk-temper1-cli-0.5.0/install
# Configure WiFi
pirate-sh --ssid hmk --wepkey password
# Reset the autorun.sh file.
rm ./autorun.sh
touch autorun.sh
# Build a new autorun.sh file.
echo 'blink yellow' >> autorun.sh
# Set up a pipe.
echo 'watch -n60 " \
./drivers/opk-temper1-cli-0.5.0/pull \
--path USB1 | \
./drivers/opk-phant-cli-0.3.0/push \
--url http://data.sparkfun.com/stream/E9fejd9efjfj \
--private_key IIF9efejfese83n" &' \
>> autorun.sh
# Set up another pipe.
echo 'watch -n60 " \
./drivers/opk-temper1-cli-0.5.0/pull \
--path USB1 | \
./drivers/opk-phant-cli-0.3.0/push \
--url http://data.sparkfun.com/stream/E9fejd9efjfj \
--private_key IIF9efejfese83n" &' \
>> autorun.sh
# Indicate that everything is cool.
echo 'blink green' >> autorun.sh
# Indicate that we are going to reboot
blink yellow
# All done, next reboot will use the autorun.sh we just built.
reboot |
Awesome! Q: At what point in the user install would this be done? Is it specific to the particular use-case and owner (i.e. are the credentials, drivers, and wifi details user-specific), or is this installing a "full basic general driver package" that people can use to get started? Or somethin' |
Here's a nice listing of various approaches to starting a script on boot: http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html |
Here's an idea for a script that set up Debian so that on boot it runs
|
The steps would be... Step 1: Identify the problem you want to solve.
rj@rjsteinert.com On Mon, Apr 27, 2015 at 4:35 PM, dwblair notifications@github.com wrote:
|
Blink cli for reference: http://blink1.thingm.com/blink1-tool/ |
Jack-in-a-Catapult approach... An autostart.sh file that downloads drivers, installs them, deletes itself, and then rewrites itself as pipe commands. # Configure WiFi
pirate-sh --ssid hmk --wepkey password
# Wait until internet is reachable
blink blue
while ! ping -c 1 -W 1 1.2.3.4; do
echo "Waiting for 1.2.3.4 - network interface might be down..."
sleep 1
done
# Indicate we are installing.
blink red
# Get the drivers and install them
mkdir /boot/drivers
cd /boot/drivers
wget --directory-prefix drivers https://github.com/openpipekit/opk-phant-cli/archive/0.3.0.zip
unzip drivers/0.3.0.zip
rm drivers/0.3.0.zip
./drivers/opk-phant-cli-0.3.0/install
wget --directory-prefix drivers https://github.com/openpipekit/opk-temper1-cli/archive/0.5.0.zip
unzip drivers/0.5.0.zip
rm drivers/0.5.0.zip
./drivers/opk-temper1-cli-0.5.0/install
# Reset the autorun.sh file.
cd /boot
mv autorun.sh autoran.sh
touch autorun.sh
# Build a new autorun.sh file.
echo 'blink yellow' >> autorun.sh
# Set up a pipe.
echo 'watch -n60 " \
./drivers/opk-temper1-cli-0.5.0/pull \
--path USB1 | \
./drivers/opk-phant-cli-0.3.0/push \
--url http://data.sparkfun.com/stream/E9fejd9efjfj \
--private_key IIF9efejfese83n" &' \
>> autorun.sh
# Set up another pipe.
echo 'watch -n60 " \
./drivers/opk-temper1-cli-0.5.0/pull \
--path USB1 | \
./drivers/opk-phant-cli-0.3.0/push \
--url http://data.sparkfun.com/stream/E9fejd9efjfj \
--private_key IIF9efejfese83n" &' \
>> autorun.sh
# Indicate that everything is cool.
echo 'blink green' >> autorun.sh
# Indicate that we are going to reboot
blink yellow
# All done, next reboot will use the autorun.sh we just built.
reboot |
I'm working on an Underscore based template that should evaluate given the data at the beginning to something like the Jack-in-a-Box script example we are working on. Very much not finished yet but figured I'd get it started. gist here -> https://gist.github.com/rjsteinert/32c43313cf80e4ce6c10 |
^ the exercise is important in order for us to figure out what data we need to feed a template to get a JITB on the other end. This will help me figure out what data structure hub.openpipekit.org needs to deliver to the JITB script builder so it can present some forms to the user and then use the input from user + data from hub.openpipekit.org and feed it into the JITB template. |
Super simple Jack-In-The-Box example that makes a light blink.
|
for r-pi
|
We've talked a bit about what a standard directory structure might look like. We've also talked about how we need a way to start pipe commands automatically.
How about something like...
autorun.sh in the example above would, on execute, start every script in the
run
folder and pipe all output to a corresponding log file. This seems pretty neat and tidy to me.But what if Debian treated autorun.sh like Windows treats autorun.inf? If we did, then we could put the above directory structure on a USB drive and as soon as you plugged it into a Debian system (R-Pi, BBB, etc.) the pipes would just start running!
What if we had a "Pipe Builder" app online that allowed people to graphically create the above structure and download it as a Zip file? Setting up a pipe might look something like...
With R-Pi it would be an extra step of having to download and burn Raspbian to an SD Card.
... In reality we're going to have to roll our own Debian distro with autorun.sh capability enabled by default so that folks can burn that to an SD Card to have an autorun capable distro running.
The text was updated successfully, but these errors were encountered: