maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Request] Sunrise alarm clock (dawn simulator) for N900? (https://talk.maemo.org/showthread.php?t=92923)

Selene 2014-03-24 12:26

[Request] Sunrise alarm clock (dawn simulator) for N900?
 
Dawn simulation is a technique that involves timing lights in the bedroom to come on gradually, over a period of 30 minutes to 2 hours, before awakening.
http://en.wikipedia.org/wiki/Dawn_simulation

There are likewise apps for iphone/android:
http://appcrawlr.com/app/search?go=g...=ipad%2Ciphone

I was thinking it would be nice to have such an app for maemo, using the camera leds. Would anyone like to try this?

gianko 2014-03-24 19:12

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
is it the N900's camera led dimmable( increase/decrease light intensity)?

pichlo 2014-03-24 21:22

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
There is a long discussion over in the Lanterne thread about what the N900 flash LED can do. In a nutshell, yes, it is dimmable (in steps; 8 or 32 depending on mode).

There is also a long discussion in the same thread whether it is a good idea to leave the LED on for any extended period of time. I personally would not risk leaving my LED on for "30 minutes to 2 hours", although the idea is not as crazy as it souds. I've just tried it: it is dark here as I type this and the LED seems bright enough to be actually useul for the purpose.

Selene 2014-03-24 21:56

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
I am not a programmer or a technical expert so I can't answer those questions.

If you take a photo with the camera app the leds seem less bright when focusing compared to the "photo flash".

If dimming is not a good idea, there are still possibilities.

For example, turn on the screen 30 minutes before the alarm, fullscreen red->orange->yellow->white with increasing brightness, and 10 minutes before the alarm turn on the camera leds. Of course, for this you would have to place your N900 on the backstand on a white surface.

Estel 2014-03-25 02:22

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1418363)
I am not a programmer or a technical expert so I can't answer those questions.

If you take a photo with the camera app the leds seem less bright when focusing compared to the "photo flash".

Wow, I haven't though that someone not participating in mentioned Lanterne discussion/hecking sources would notice that. Respect :)

In a nutshell, indeed, there are two modes. The "basic" one, as used for all torch applications, got lesser maximum brightness value (due to lesser current), but is able to perform 100% duty cycle (aka "just be turned on"). The "flash" mode is much more powerful, but available only in duty cycles (with maximum one around 75% IIRC, but don't quote me on that - details in the already mentioned Lanterne link provided by pichlo), and rightly so, as using it on 100% would damage leds pretty quickly.

Now, for the purpose of program proposedd here, only the "torch" mode is approriate, as I don't think that stroboscopic effect is good for a healthy sleep/awakening ;) (unless someone want to simulate dawn in a hurricane-hit forest, with light passing through shaking branches/leaves).

Quote:

Originally Posted by Selene (Post 1418363)
If dimming is not a good idea

Why? "Dimming" (to be precise, changing current in a steps, in our case) is neutral for a diode. AIUI [/b]pichlo[/b] meant leaving flash diodes turned on for a prolonged time, no matter what the brigtness level.

Here I disagree, BTW - my trusty N900 is helping me with various conservation tasks in not-so-easily-accessible places for years already, and I regularly leave flash diodes at maximum "torch" mode brightness for a hour or so, as it's lighting up my patient's internal organs workplace. Zero adverse effects observed - in fact, I've actually had some unpleasant surprises with other hardware components, and I guess that those leds (and their backscreen/keyboard counterparts) are the things that will be (amongst) longest living parts in N900's motherboard, no matter of (ab)use.

/Estel

// Edit

In fact, what you would like to achieve could be done with a rather simple script (written with help of Lanterne discussion and its documentation), executed by any alarm app that can trigger custom command on alarm.

Executing command on alarm would be, probably, a few lines of code in CSSU'ish alarm replacement (or update, I don't remember if it was open thing in vanilla). IIRC, freemangordon was the author of CSSU'ish latest version - it could be good idea to post a feature request in CSSU's bugzilla. If that part is done, you have 99% of work done.

/Estel

Otherwise, there should be, already available, "eggtimer" programs that can trigger custom commands, but setting them up for alarm clock job is more tedious (and less "clean") job than using Maemo's integrated alarm would be.

pichlo 2014-03-25 06:26

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Estel (Post 1418381)
AIUI pichlo meant leaving flash diodes turned on for a prolonged time, no matter what the brigtness level.

Correct. Please note that I did not express my personal opinion, only said that there are different opinions and pointed out the thread.

Quote:

In fact, what you would like to achieve could be done with a rather simple script (written with help of Lanterne discussion and its documentation), executed by any alarm app that can trigger custom command on alarm.
Yeah, cron and alarmed come to mind.

Selene 2014-03-25 21:20

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Estel (Post 1418381)
Wow, I haven't though that someone not participating in mentioned Lanterne discussion/hecking sources would notice that. Respect :)

Thanks:p

I agree integration with the CSSU Alarm clock would be a good option.

Quote:

Originally Posted by pichlo (Post 1418391)
Correct. Please note that I did not express my personal opinion, only said that there are different opinions and pointed out the thread

Sorry I misinterpreted your post.
Are there any known cases of failed camera leds on the N900?

If someone is willing to write the code for this feature I'm willing to risk my leds and will report if they still work in a few months:rolleyes:.

Estel 2014-03-26 04:06

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1418493)
Are there any known cases of failed camera leds on the N900?

As far as my notorious TMO'ing knowledge goes, it's exactly 0 cases. (which bring it the same as confirmed... Blast "confirmed", in fact "even-remotely-plausible" cases of overclocking damage. But that's totally different thing). Unless someone torn apart secondary's board flex cable, but then, diodes are least of the problems.

/Estel

sixwheeledbeast 2014-03-26 13:32

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
The main flaw in this is having to have the Lens cover open and the device screen down.

This could help you, step by step instructions on setting up a Internet Radio Alarm Clock that slowly increases volume.
http://talk.maemo.org/showpost.php?p...7&postcount=10

Selene 2014-04-02 20:34

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by sixwheeledbeast (Post 1418564)
The main flaw in this is having to have the Lens cover open and the device screen down.
postcount=10[/url]

I don't really see a problem with that? Unless your nightstand is made of concrete..
You could also put it on the backstand or make some kind of docking station, aiming the flashlight at at white wall.

Quote:

Originally Posted by sixwheeledbeast (Post 1418564)
This could help you, step by step instructions on setting up a Internet Radio Alarm Clock that slowly increases volume.
http://talk.maemo.org/showpost.php?p...7&postcount=10

Thanks, but my programming experience is 0.0 and I just recovered from RSI enough to browse the internet a bit so starting now is probably not a good idea.:(

I just made this thread to see if there are more N900 owners with trouble getting up in the morning;) (and hopefully someone capable of making such an app)

sixwheeledbeast 2014-04-02 22:06

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1419657)
I don't really see a problem with that?

For me I would forget to do that every night. It would need some reminder to open the lens before bedtime.

Well you could use my instructions to control the the flashlight instead of the volume, however, if you can't do this you will have to wait for a developer to need it enough to create it.

zlatokosi 2014-04-02 22:34

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Since no one has mentioned it yet, SleepAnalyzer (http://wiki.maemo.org/SleepAnalyser) has a sleep cycle alarm (and music I believe - for lucid dreaming) that wakes you up with a "slow" alarm. No lighting integration, but personally I doubt it would be pleasant to wake up to the N900's LED lights anyways.

rotoflex 2014-04-03 06:35

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1419657)
I just made this thread to see if there are more N900 owners with trouble getting up in the morning;) (and hopefully someone capable of making such an app)

I used to, but that has changed since I started using the N900 as an alarm clock. The internet alarm clock script I wrote has been the most reliable way of getting me to wake up that I have ever had. I am afraid now of separation from my N900!

The secret really was to just have classical music come slowly up & play for 15 minutes before the regular alarm goes off. Apparently the fade-in slowly wakes you up enough to not need to abruptly just hit snooze when the alarm goes off.

I would have put it together as an app, but was never able to set up a successful programming environment.

Selene 2014-04-03 22:18

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by sixwheeledbeast (Post 1419662)
For me I would forget to do that every night. It would need some reminder to open the lens before bedtime.

You could use Ledpattern-editor to turn the status led bright white while charging. That would force me to turn it screen down before going to sleep. If you forget it every once in a while you just get waken "normally" by the alarm clock.


Quote:

Originally Posted by zlatokosi (Post 1419666)
Since no one has mentioned it yet, SleepAnalyzer (http://wiki.maemo.org/SleepAnalyser) has a sleep cycle alarm (and music I believe - for lucid dreaming) that wakes you up with a "slow" alarm. No lighting integration, but personally I doubt it would be pleasant to wake up to the N900's LED lights anyways.

Thanks! I will give this one a try. I doubt the flash leds alone will wake you up (unless they are pointed at your face) but it should put you in a lighter sleep. Personally I'm quite sensitive to light; if I forget to close my rolling shutters I usually wake up at sunrise.


Quote:

Originally Posted by rotoflex (Post 1419694)
I used to, but that has changed since I started using the N900 as an alarm clock. The internet alarm clock script I wrote has been the most reliable way of getting me to wake up that I have ever had. I am afraid now of separation from my N900!

The secret really was to just have classical music come slowly up & play for 15 minutes before the regular alarm goes off. Apparently the fade-in slowly wakes you up enough to not need to abruptly just hit snooze when the alarm goes off.

I would have put it together as an app, but was never able to set up a successful programming environment.

Thanks I'll look into it!

Selene 2014-04-06 15:51

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Sleepanalyser is a nice app, I like it!

But to stay ontopic:
To experiment a bit I thought I could use Alarmed to simply start the Flashlight or Lanterne App x minutes before the alarm. This should be possible, right? Unfortunately I can't get it to work. In fact, I can't start any App from Alarmed or x-terminal. Any help?

Copernicus 2014-04-06 16:12

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1420116)
In fact, I can't start any App from Alarmed or x-terminal. Any help?

Ah, due to a variety of reasons, most apps end up getting installed under the /opt directory. So, you'll usually have to give the full path name to run them. For example, Lanterne is installed into the directory /opt/lanterne, and the full path name to reach the executable is:

/opt/lanterne/bin/lanterne

Selene 2014-04-06 16:31

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Copernicus (Post 1420119)
Ah, due to a variety of reasons, most apps end up getting installed under the /opt directory. So, you'll usually have to give the full path name to run them. For example, Lanterne is installed into the directory /opt/lanterne, and the full path name to reach the executable is:

/opt/lanterne/bin/lanterne

Thanks, it works!
I'll try it a few nights to see if it works for me..

Estel 2014-04-06 16:43

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1420121)
Thanks, it works!
I'll try it a few nights to see if it works for me..

Via the same way, you could even run a simple shell script that would increase light intensity gradually, over time (considering how fluent Copernicus is with driving N900's LEDs around like a bicycle, he would probably write such script in 5 minutes). Although, I'm not sure if light intensity matters for Sunrise Clock when using such (relatively) weak source as our flash LEDS.

/Estel

Copernicus 2014-04-06 17:22

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Estel (Post 1420122)
Via the same way, you could even run a simple shell script that would increase light intensity gradually, over time (considering how fluent Copernicus is with driving N900's LEDs around like a bicycle, he would probably write such script in 5 minutes).

Well, yes, I guess I probably could. ;) But just to reiterate my position from last year, after having studied the documentation on the N900's flash hardware, I'm just not comfortable with driving the white LEDs constantly at high power, as that can potentially burn them out. Lanterne's torch runs the LEDs at the only power level that has been explicitly labeled as safe for continuous use, so I'm just going to stick with that... :)

nokiabot 2014-04-06 18:23

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Why not create an app that sounds user selected alarm gradually increases the brightnes (flashing every 6 seconds for 3 minuts only when the phone is upside down with lens cover open) maybe like a plugin for lalterne.

nokiabot 2014-04-06 18:33

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
@Copernicus please make a fork of lalterne excliptly with the feature that can turn on the leds with the aid of light sensor (configurable values for light sensor sensivty and leds) it might sound dumb or awkard but it will be a killer feature for me as its time for heavy loadshedding ,you know its summer time... i requested it long ago but you turned it down :(

Copernicus 2014-04-06 18:42

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by nokiabot (Post 1420131)
@Copernicus please make a fork of lalterne excliptly with the feature that can turn on the leds with the aid of light sensor (configurable values for light sensor sensivty and leds) it might sound dumb or awkard but it will be a killer feature for me as its time for heavy loadshedding ,you know its summer time... i requested it long ago but you turned it down :(

Well, yeah, I've gotta admit that it does sound odd. (And, as I mentioned before, it would turn on the LEDs every time you put it in your pocket!) But I'll take a look... :)

nokiabot 2014-04-06 19:02

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Thanx i need nothin fancy all i need is a gui that does it :) and as a preacaution you can set a timer that disables leds after 3 minuts unless the user has popped up the values :)

Estel 2014-04-07 05:49

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Copernicus (Post 1420125)
Well, yes, I guess I probably could. ;) But just to reiterate my position from last year, after having studied the documentation on the N900's flash hardware, I'm just not comfortable with driving the white LEDs constantly at high power, as that can potentially burn them out. Lanterne's torch runs the LEDs at the only power level that has been explicitly labeled as safe for continuous use, so I'm just going to stick with that... :)

No, no, I just mean *lower* levels at start, then, gradually, increasing output to a max of same wattage that LEDs have in torch mode. Not over-driving them, of course :)

Sure, it would require using the second mode, but as long as you keep with not exceeding power equivalent to the "safe" torch mode, you're doing the same thing, with just low power level at start.

/Estel

Copernicus 2014-04-07 08:53

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Estel (Post 1420194)
No, no, I just mean *lower* levels at start, then, gradually, increasing output to a max of same wattage that LEDs have in torch mode. Not over-driving them, of course :)

Sure, it would require using the second mode, but as long as you keep with not exceeding power equivalent to the "safe" torch mode, you're doing the same thing, with just low power level at start.

Whoa, second mode? I don't remember a second mode... Hmm, sounds interesting!

Yeah, looking again at the ADP1653 data sheet, it only seems to support integer values between 1 and 11 for "torch mode" usage, 1 representing the low value of 50 mA and 11 being the high of 200 mA. And, from the rx51 camera code,

Code:

static struct adp1653_platform_data rx51_adp1653_platform_data = {
    .power            = rx51_adp1653_power,
    /* Must be limited to 500 ms in RX-51 */
    .max_flash_timeout    = 500000,        /* us */
    /* Must be limited to 320 mA in RX-51 B3 and newer hardware */
    .max_flash_intensity    = 19,
    /* Must be limited to 50 mA in RX-51 */
    .max_torch_intensity    = 1,

    .max_indicator_intensity = ADP1653_REG_OUT_SEL_ILED_MAX,
};

So only the low value of 50 mA is supported. I'm still not seeing any way to go lower than 50 mA here...

pichlo 2014-04-07 11:53

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Copernicus (Post 1420220)
I'm still not seeing any way to go lower than 50 mA here...

What is the fastest the LED can flash in the strobe mode? If fast enough (say 25 times per second or more), then lower values could be achieved by varying the duty cycle.

Edit: Found it. If I get it right, timing is in multiples of ~54ms, totally unsuitable for emulating steady light with very fast strobing.

Estel 2014-04-08 11:44

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Copernicus (Post 1420220)
Whoa, second mode? I don't remember a second mode... Hmm, sounds interesting!

Yeah, looking again at the ADP1653 data sheet, it only seems to support integer values between 1 and 11 for "torch mode" usage, 1 representing the low value of 50 mA and 11 being the high of 200 mA.

(...)

So only the low value of 50 mA is supported. I'm still not seeing any way to go lower than 50 mA here...

Ah, bummer, so lower than 50 mA isn't possible :/ Sorry, I screwed it in memory with the flash (strobo) mode (the thing I called 2nd mode), which is used for much more powerful, but blinking, outputs. I stand corrected.

As a side, note, it's good news for Selene - apart from regular torch light intesity that she/he knows (which is quite weak, but barely usable for her/his purposes), she/he can also use a up 4x more powerful current for driving leds, which roughly correspond to 4x more powerful sunrise emulation! As far as she/he isn't afraid of frying own LEDs, of course.

Quote:

Originally Posted by pichlo (Post 1420243)
What is the fastest the LED can flash in the strobe mode? If fast enough (say 25 times per second or more), then lower values could be achieved by varying the duty cycle.

(...)

If I get it right, timing is in multiples of ~54ms, totally unsuitable for emulating steady light with very fast strobing

Indeed unsuitable for sun emulation I think, but quite useful for very bright flashlight (if one can get used to still-visible, little strobing). I have been using, without incidents, a rip-off Lanterne code, that - in torch mode - strobed LEDs with absolute max power on maximum duty cycle (lowest interval between strobes) - for so long time, that I actually forget its custom, and yesterday overwritten it with new version from "mainstream", resulting in me needing to rip it off, again ;)

Anyway, the point is that I was using the "unsafe" mode for many months, with torch enable for long periods of time - 30 minites, hour, two hours (was too lazy to remove timelimit, so I just re-enabled it when hit the clock), etc. while working. As said, no adverse effects, except for LEDs getting *a little* more warm, when active for a long time.

/Estel

Selene 2014-04-08 22:42

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Too bad indeed that 50 mA is the minimum. Using the red led a few minutes beforehand to simulate a red sun rising - and maybe shock your eyes a little less - would be nice :p.

Or, as I mentioned before, you could use the screen..

I've tried the Alarmed/Lanterne thing yesterday, and I must say I'm not disappointed; if your eyes are fully adjusted to the dark by sleeping in a pitch black room for 7 hours 50mA is already pretty bright. I'm going to experiment a bit more to see if I would want more than 50 mA. I tried the 320 mA strobe flash btw, quite a difference indeed!

P.S.: I'm a dude. (Selene is the greek goddess of the moon - I guess Helios would have been a better pick regarding this thread ;))

Estel 2014-04-09 02:08

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Selene (Post 1420448)
Too bad indeed that 50 mA is the minimum. Using the red led a few minutes beforehand to simulate a red sun rising - and maybe shock your eyes a little less - would be nice :p.

You could script enabling of red led, then, after selected period of time, white one, why not. I just guess that red LED would have 0 effect on your sleep phase, even inside pitch dark room - well, you would have to test it yourself.

And of course, I know where Selene/Luna/etc comes from, thats why I wasn't sure about gender :)

/Estel

Selene 2014-04-14 18:22

Re: [Request] Sunrise alarm clock (dawn simulator) for N900?
 
Quote:

Originally Posted by Estel (Post 1420459)
You could script enabling of red led, then, after selected period of time, white one, why not. I just guess that red LED would have 0 effect on your sleep phase, even inside pitch dark room - well, you would have to test it yourself.

And of course, I know where Selene/Luna/etc comes from, thats why I wasn't sure about gender :)

/Estel

The red led is indeed not very bright, but still I can easily tell if it's on or off with my eyes closed. Also, if you wake up and see the red led on you would know it's almost time to get up.


All times are GMT. The time now is 10:11.

vBulletin® Version 3.8.8