blink1 icon indicating copy to clipboard operation
blink1 copied to clipboard

missing tool: headless server start/stop

Open brunobord opened this issue 9 years ago • 6 comments

Hi,

I'm just starting to play around with my blink1(mk2) devices but I think I'm missing something: a headless tool to control (i.e. start/stop) the mini HTTP server. It looks like the only way to run this HTTP Server is to be on Windows or Mac OSX, start the BlinkControl program and check the appropriate service.

As far as I can tell (but please, telle me I'm wrong) there's nothing for Linux, Raspberry PI, and there's no way to control it on OSX via the command line. I think it'd be handy to provide this tool in the releases, this way we could control the blink1 lights via a simple HTTP request, from the LAN or over the Internet.

Though, I don't know if it has to land in the blink-tool binary or if it needs a specific binary/executable to be released.

brunobord avatar Jul 23 '14 12:07 brunobord

i'm with bruno, i miss a headless server, so it can run in the background without having to launch BlinkControl, i managed to compile it on ubuntu but well... i think they should be independent apps , the server for controlling the lights and receive ifttt events and blinkcontrol for configuring patterns, events, etc..

pyro-x avatar Aug 15 '14 19:08 pyro-x

Most of our server and embedded customers use blink1-tool command-line program or Python or C to control blink(1) devices directly. This is mostly because their infrastructures require minimum dependency changes. We've designed for the use cases: a) GUI user on Mac/Win: use Blink1Control, b) server/embedded user on Mac/Win/Linux/etc.: use blink1-tool commandline or language API.

It sounds like there's the need for a new tool for server/embedded people: a commandline-invoked blink(1) manager that responds to HTTP requests. Does that sound about right? (there's a very trivial one that's not very good in https://github.com/todbot/blink1/tree/master/commandline/server but I wouldn't recommend it.

todbot avatar Aug 15 '14 19:08 todbot

I was looking for something like this, but since these comments are a year old this might be outdated: The Linux Readme mentiones a blink1-server-simple, which I could not find anywhere. So is this tiny server the current way to do this (it seems to work)? I am just playing around right now, so I am not looking for something productive.

MrMovl avatar Sep 30 '15 15:09 MrMovl

@MrMovl, apologies for hiding blink1-tiny-server (originally called blink1-simple-server). I've updated the READMEs a bit to be more helpful.

You can read about blink1-tiny-server here: https://github.com/todbot/blink1/tree/master/commandline/server

To build it:

cd blink1/commandline
make blink1-tiny-server

Usage is currently:

usage:
  ./commandline/blink1-tiny-server [options]
where options are:
  -p <port> -- port to start server on

Supported URIs:
    /blink1/on  -- turn blink1 on full white
    /blink1/off -- turn blink1 off
    /blink1/fadeToRGB?rgb=%23ff00ff&time=1.0  -- fade to a color over a time
    /blink1/blink?rgb=%23ff0ff&time=1.0&count=3 -- blink a color, with time & repeats

todbot avatar Sep 30 '15 18:09 todbot

Thanks for the quick reply! Seem I did the right thing, just tried to read the id (as the documentation tells you to), which is not supported. If I get the time I'll look into this server, maybe the support could be expended.

MrMovl avatar Oct 01 '15 18:10 MrMovl

Yeah blink1-tiny-server is really basic at the moment. Only supports those 4 URIs mentioned above.

todbot avatar Oct 01 '15 18:10 todbot