Raspberry PI/Jessie/Nodejs/Javascript based Tardis Clock

Started by jorwick, Jan 12, 2016, 11:57 pm

Previous topic - Next topic

pizzaroger123

I like this idea for the sound effects, but the clock stuff with the theme song and the interior light doesn't seem right. It might be good for a model build, but  for a full size build, I think some people just want the demat/mat and cloister bell (what is the cloister bell from anyways, IDK ???) To be able to play at the press of a button and the top light to flash . Why is it so hard to find something like that, I guess because TV effects :P. Maybe one day you could do something like this, and if you did that would be Fantastic (also after the demat and mat sounds play, I would like to see the light stay on until you press another button or  something). But for now this a neat idea, good job.

Hope this paragraph isn't enough for you to handle, Roger

P.S. is there an off button


galacticprobe

Feb 16, 2016, 11:04 pm #31 Last Edit: Feb 16, 2016, 11:06 pm by galacticprobe
Quote from: pizzaroger123 on Feb 16, 2016, 10:30 pm
...and cloister bell (what is the cloister bell from anyways, IDK ???)

The Cloister Bell is a 'something-really-extremely-bad-is-about-to-happen' warning alarm the TARDIS sounds when that impending doom is fast approaching. It was first used in Tom Baker's (Doctor 4) final story, "Logopolis", and the sound of it has remained unchanged since. It even appeared in the 1996 TV Movie and is still being used with Peter Capaldi (Doctor 12).

Quote from: pizzaroger123 on Feb 16, 2016, 10:30 pm
P.S. is there an off button

Who would want to turn a TARDIS off? :o (It's almost like murder; a TARDIS is alive, after all. ;) ;D)

Dino.
"What's wrong with being childish?! I like being childish." -3rd Doctor, "Terror of the Autons"

jorwick

Quote from: pizzaroger123 on Feb 16, 2016, 10:30 pm
I like this idea for the sound effects, but the clock stuff with the theme song and the interior light doesn't seem right. It might be good for a model build, but  for a full size build, I think some people just want the demat/mat and cloister bell (what is the cloister bell from anyways, IDK ???) To be able to play at the press of a button and the top light to flash . Why is it so hard to find something like that, I guess because TV effects :P. Maybe one day you could do something like this, and if you did that would be Fantastic (also after the demat and mat sounds play, I would like to see the light stay on until you press another button or  something). But for now this a neat idea, good job.

Hope this paragraph isn't enough for you to handle, Roger

P.S. is there an off button


I have already started using it as a clock when I am outside, but of course you just turn on "silent" mode for the clock at all hours, and its no longer a clock. Then you can just use the demat/mat/cloister.  Don't want to do themes? Well don't hit the themes button :)  Basically you just don't use any features you don't want.

If you don't want to use the light sensor - or don't hook one up- the CPU just thinks its always dark then. Don't want interior lights, don't hook them up.  Don't want a given button - don' hook it up  ( The button would still appear on the web page.. but see below..)

In the next iteration I will add

1)  third output for separate control of the Interior light and the Sign box lights
2) Grid allowing user to set Light states for all three light outputs ( Top light, interior light, Signboxes)  in Silent mode, when its "dark" ( light sensor activated)  and when its "light" and then it will just set it to that state when its done doing something
3) Allow user to define what Audio File will play and what the lights will do ( damped sinusoidal ( with params)  or flicker (with params) or off/on at DIM level   when a given button input is pressed ( which will include the option to do nothing.  The Damped Sinusoidal function  will allow you to set  phase, period, max duration, decay speed, amplitude and slope. With 0 in the correct parameters you can also get a straight sinusoid , a sinusoid that varies from 80% to 20%  or whatever.  The flicker is basically just a timer parameter for the max of  often each level should be used.
4) add in a button option to simply do Toggle off on. Press button once, light comes on. Press it again it goes off.  No sounds.
5) Dynamic web page generation such that state is more obvious and only defined buttons show up.

It seems to me that this  would satisfy 98%  of what people have told me they would want this to do.

So  in your case, you would log in via the Web page, set all hours to silent mode, set the top light at whatever dimmer value you want during that mode ( 0-100%)  and then set up a button for demat, materialization and cloister - using whatever files  you saw fit to upload for those sounds ( or use the ones provided) - and set up  the top light to run during those effects  as you saw fit.   Of course You wouldn't bother hooking up the Transistors for interior and sign boxes, and just run the top light.


However, I know that a number of people do  use interior lighting, signbox lighting or both as well at a top light.
As long as you aren't drawing more than 60 Amps on  a transistor (you will need a heatsink if you do) and your power supply can give you the amperage you want..   then any 12 volt light source will do. The Strip LEDS are very cheap of course, and would make a good choice for one or all of these.   The stepdown chip allows the PI to run off of the 12 Volts too, so you can run this off of a car battery or whatever 12 volt source seems best to you. You could of course install a power switch on your power leads, giving yourself an "Off button" if you wanted it.  Its undocumented at the moment, but hitting the cloister bell button in the current code while any effect is running will cancel it.  In te next version, I think that sort of toggle would just be built into each and every one of the buttons.

jorwick

Diophantine volunteered to be a guinea pig for me, and actually forced me to test and refine.  The New Procedure to load this - from the very beginning -  is:

LOAD the OS.

1.   First download the lastest NOOBS zip file for Jessie  at https://www.raspberrypi.org/downloads/noobs/
2.   Download and install SDFormatter  (or similar  utility) from https://www.sdcard.org/downloads/formatter_4/eula_windows/
3.   Insert your SD card into your PC  and format it to its full size. In SDFormatter, choose the option button and select "Format Size Adjustment" to ON. Then format the card
4.   Use  winzip or similar utility to unzip the NOOBs zip file onto the SD CARD.
5.   Remove the SD card from your PC , put it into your PI ( with the power off ) and boot.
6.   At the menu , Select Raspian install, and select your region at the bottom. Then click "install" at the top left. In about 30 Minutes the install will complete and you can click the popup window to reboot.

Load The TARDIS Clock

1)   After reboot the Pi should boot into the GUI.  Right Click on the speaker at the top left and select analog. This directs audio output to the mini-jack
2)   Go to preferences, and set the system to boot to CLI ( There is some incompatibility with pi-blaster that prevents the GUI from booting. (If you think you need the GUI load VNC).Also turn on i2c, exit the menu and when asked click yes to reboot.
3)   The next time it boots it should boot only to the command line  At the command line type Verify you are in the PI home directory

Quotepi@raspberrypi:~ $ pwd
/home/pi


4)   type the following to copy the TardisClock application , web pages and sound files down from the git repository. This takes around 10 minutes

Quotepi@raspberrypi:~ $ git clone git://github.com/jorwick/tardisClock


5)   Enter the newly created directory tardisClock

Quotepi@raspberrypi:~ $ pi@raspberrypi:~ $ cd /tardisCock


6)   Run the Install Script in that directory with root permissions. This will update Jessie with any fixes, load and install pi-blaster  (for PWM led control) , load the required node.js modules and build a tardisclock service. When complete the script will automatically reboot the machine, and when it boots back up, your TARDISclock should be running.This takes about an hour.

Quotepi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo ./installScript.sh


7) reboot

Quotepi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo reboot


8)    find out what your ip address is using ifconfig.  The HTML control page will be at http://<ip address> :8080  - in the example below it would be http://192.168.0.43:8080

Quotepi@raspberrypi:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:3c:40:64
         inet addr:192.168.0.43  Bcast:192.168.0.255  Mask:255.255.255.0
         inet6 addr: fe80::cbc6:b07:4e9d:62ef/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:275897 errors:0 dropped:0 overruns:0 frame:0
         TX packets:133016 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:393553212 (375.3 MiB)  TX bytes:10803791 (10.3 MiB)


You should now have a working copy of TardisClock - wire and enjoy.
So is that plug and play enough?


  Dio also has a special occasion coming up and I have committed to make enhancements before then.. watch this space.

Mind, this script does not enable the RTC module. That will need to be done separately.. but then if you have an IP connection, you don't really need it. The Pi will set the time via NTP..

bluebird40


Can I used a Raspberry Pi 3?  Is there any changes needed?