Clock for RS Media

45 posts / 0 new
Last post
FreddyA
FreddyA's picture
Clock for RS Media

I was looking around for a java browser to tinker with now that there is some advances into the USBnet and ran into this alarm clock. I placed the .jar file inthe java folder and it came up! it states the date of Jan 1, 1970. clock starts ticking at 12:00am. Is there a way to attach a button battery to keep the time and maybe someone can tweek the clock so that we can change the time and set alarms?

 

UPDATE: thanks to the awesome advances you can now set the date and time by using the RS Media Development Kit USB console. Great work!

NEW UPDATE! you can now set the time and alarms on the Alarm Clock relesed by Helibot! Try it with my rooster alarm found in the RS Media's Download center.

FREEEK
FREEEK's picture

I think you should have the source code for this program!
(I'm not a programmer but I think that a simple one [concerning graphics] can be made with the help of Java SDK for RS Media). I see the clock with those 2 "buttons" down on the blue bar like those on the NOKIA phones!

YOU STARTED A HOT DISCUTION as I see it!!! Well done!!!
I RATED THIS THREAD because it's one of the BEST TOPICS I have seen lately!

Can you send us a link or can you post it somewhere (the .jar file) for those interested? THANKS

FreddyA
FreddyA's picture

Here is the link to the jar file. I hope there is some something that can be done with it. I always wondered why the RS Media didnt have a clock and alarm.. made no sence.

TikaC
TikaC's picture

Actually, Helibot was looking into this too, I believe. The thing is, while there does seem to be some clock support, hacking a battery to keep it "alive" when the bot is turned off will take a lot of work. Anyone up to it? :)

FreddyA
FreddyA's picture

I would think that like a computer motherboard, the chip would need to maintain minimal power to keep the set time. Maybe if the chip was supplied with its voltage after power down it would retain the time set. Or is it a seperate chip that keeps the time? I read somewhere here that the robot powers up with jan 1, 1970 12:00am every boot up so it must have most of the needed "stuff"

Shai Alyt NEMO
Shai Alyt NEMO's picture

I think, it is not possible (or very hard to implement, involving complex electronics and OS modifications), because on PC motherboards RTC (Real Time Clock) is a special CMOS chip, most commonly powered from a CR2032 clock lithium battery. It keeps a real time (and a motherboard BIOS settings) regardlessly of a main motherboard power. The CPU just reads the time from that chip.

Like this:

 

 

Again and again, it's strange, why WowWee did not implemented to RSM such a cheap chip ;) It can indeed add much functionality to RSM at almost no additional cost (imagine RSM, waking you up in the morning!)

Just another evidence of the fact that RSM (both hardware and software) is like an early beta-version (never to be debugged and finished to release level) Cry

FREEEK
FREEEK's picture

sadly :(

TikaC
TikaC's picture

I think they didn't do it because RSM would have to be on battery power (and we all know how long those batteries (don't) last) or plugged in with an A/C adaptor which is not available outside the US (or is a separate purchase).

But I do agree, it would have been nice.

FreddyA
FreddyA's picture

I have a alarm radio sits on the counter in the kitchen. Ever so often (not very) the clock is blinking "help set time". Power outage or someone unplugged it to use the socket. The 9V in it is dead obviously but that does not bother me - pushing buttons makes me happy. Doesn't take much to make me happy, If I could find a way to at least set the date and time it would mean worlds to me. The alarm clock.jar file I have in the RS Media has a menu option but nothing I do makes it open up. I wonder if there could be a way to use the USBnet to update the date and time on the robot when connected. I lack the brains to do so, and there are so much brains at work here. If someone could go at the alarm clock.jar to make the darn menu work... Better than me take'n my sticks and stones to it.

Shai Alyt NEMO
Shai Alyt NEMO's picture

Maybe, it's a (not very useful) workaround - to set time manually at every boot. I hope it is possible to set time from Linux command prompt (for those happy ones (like me ;), who have a serial console access). OK. I'll try.

Maybe, it's possible to write a shell script for manually setting a time using RSMs hands "media" buttons...

But. Let's think further. Let say, we setted the correct time. And the system clock ticks and time updates. And we want to make a funny alarm-clock out of our RSM. The question is: how to prevent (from shell script) an RSM from go to sleep mode and then to automatic power-off. I don't know how it can be done. I have experimented with serial console access and it seems that RSM stops responding to body movement commands from console when he goes (after a relatively short timeout) to sleep mode. It looks like his body lives somewhat independently of his Linux "brain" and when the body decides to go to sleep, brain cannot wake it up. Only IR command from remote can do. I sincerely hope that I missed something, but at least now I don' know a workaround for this problem.

And without the solution for this problem all the tinkering with time is just a practically useless experiment.

Helibot
Helibot's picture

See next post

Helibot
Helibot's picture

Hi FreddyA,
Cool topic, Its not a practically useless experiment!!
I have done some simlar work with makig RSMedia into a clock by programming him with C and using the Nano-X windows (which is the base of the Linux X-windows thats used for RSMedias LCD screens and menus).
So I can help with a few things:-
*The date/time for RSMedia can be set from the command line. The normal Linux Date command can be used . use 'date -s MMDDhhmmYYYY' EG date -s 072100142008 would set the date to July 21st 2008 12:14am. This can be done from the command line , it should also work from a bodycon script.
*Setting the time has to be done each time you repower RSMedia :-(. I looked to see if the CPU has any lowpwer or external clok power pins, but there is none.
*I have found that you can stop him going to sleep by kill all the RSMedia custom application with 'killall Nano-X' (from the command line). This stops all the robot interactions (eg all remote and bodycon stuff). I hope to investigate this a bit further to find exactly how low power is triggered....but havent got to this yet :-(

Cheers
Helibot

Shai Alyt NEMO
Shai Alyt NEMO's picture

Cool, Helibot!

As I understand, if we kill Nano-X this will stop all the standard RSM activities. He will not respond to sensors and IR commands, lose his "consciousness" and became a "zombi", doing nothing at his own, directly under our program control. That's OK. But will the standard body control and media scripts work in this case? Or we will be forced to directly access his hardware at low level from our binary file, written in C?

FreddyA
FreddyA's picture

@Shai Alyt NEMO, I have set the time and left him to go to sleep plugged in overnight, when I wake him up in the morning the time is still ticking. Also I shut the alarm clock.jar down and change mode let him sleep, wake him then return to games and start the clock and still ticking. So like you said if there is a way for shell script to manually set time using RSMs hands and wake him to say play a song or run a bodycon, what a great feature to have.

@Helibot, How about using the Linux X-windows used for RSMedias LCD screens and menus to make something like/or use of the alarm clock.jar Even to make a bodycon script that could be run to set date time would be nice trick to start with. I Usually keep my rs media plugged in and on even when changing the rechargeable batts he he..

Helibot
Helibot's picture

Hi Shai Alyt NEMO,
Once 'killall nano-X' is done then nothing works except linux commands ,standard body control and media scripts wont get run. If you ran 'killall nano-X' from a bodycon, as soon as all commands in that bodycon script are finished , then nothing more will happen!! If you had a serial console then you could restart it all by running /usr/bin/robot/run.sh.
(Also note that the command is 'killall nano-X' (not Nano-X) as I wrote before)
Note there is a lowpower mode and a powered off mode - in lowpower mode he does remember the time. If he is powered by AC he will only goto lowpower mode.

Freddy A
I have a program that can set the date/time using his remote - it also shows a digital clock on his LCD. Program is not really finished yet , its a bit flaky and I was planning to add alarm clock functionality to play sound/bodycon at certain times- I will see what I can do to clean it up and release a copy as it is- may take awhile though (I'm busy with 'USB console' work at the moment).
Cheers
Helibot

FreddyA
FreddyA's picture

That is good news Helibot! Awesome work you are doing, looking forward to your USB console and other updates.

TikaC
TikaC's picture

On getting the menu on the Java app to work, see page 34 and 35 in the RS Media owner's manual ("Game controls Overview") - especially page 35 where it has a table of Moble Phone Keys and RS Media Remote Controller Buttons. Menu might be either 'a' or 'b' on the RS Media.

I haven't had time to play with this (still working on getting the update to the Dev kit done and working as well). But maybe this will help work it from the interface itself?

FreddyA
FreddyA's picture

Thanks TikaC, that was my first logical step as soon as I had the alarm clock.jar running, It would be soft keys B for menu & C for exit if it worked. I have been clicking away for days! I even replaced the batteries in the remote just in case. Thanks for the tip though. Keep at the Dev Kit, I am excited to see your developments.

Shai Alyt NEMO
Shai Alyt NEMO's picture

That's really great news !

It's very good, that RSM is not going to power off mode and keeps the clock for indefinitely long time while on AC power. So, the dream about the RSM, waking you up at morning seems to be quite realistic.

And of course, great respect goes to Helibot! I hope, you will (sooner or later) find the time and inspiration to finish that "alarm clock" project for RSM. And I wish you success!

BTW, your "USB console" project promises to be just revolutionary, especially for users that do not have a serial console hack implemented.

TikaC
TikaC's picture

What Helibot doing with the USB console thing is amazing! He's come a long way in a short time. He's still working on it though. I'll be including his work in our dev kit.

FreddyA
FreddyA's picture

Id like to give thanks to the accomplishments of Helibot, TikaC and all others involved. I was able to set the time by USB console. I then opened the java clock in games and presto!

I still can't set the time throught the interface or set any alarm. but its the time and date! I have done a few tests like power down, reset, and such but the only way to set the time is with the new Development Kit USB console. GOOD NEWS! one of the first programs to be released is a pretty advanced alarm clock by Helibot! Go Helibot!

Helibot
Helibot's picture

Hey all,
Just an update on the RsmAlarmClock program I'm writing:-
Ive added alarm support for it. I've just had the first successful alarm get triggered - it only printed ***Alarm*** to the console, but it worked!! Next I will trigger an action to be performed (I should be able to get him to play a sound or music file, and hope I can make him run a bodycon script!!)
The alarm is configured by a windows style 'ini' file, which is read by the program when it starts (eventually I will allow it to support multiple alarms).
I will try to get a photo of it running soon and post it here.
Still planning to get the sourecs and binary together and release it all. Maybe some others make like to extend it further?. (Not sure when this will be though- Ive got a lot of other things happening in the next week or so.)
Cheers
Helibot

FreddyA
FreddyA's picture

Thats music to my ears! If you need any testing done let me know!!

Helibot
Helibot's picture

Hello all,

Here is a picture of my RSMAlarmClock application.  The program is running at the same time as the robot main programs, so its drawing its graphics in front of the 'Control mode' screen.

RsmAlarmClock

The graphics are not that nice yet :-(, But it works. (There are other things to get going first!.)

The progam can so far do this:-
Allow the system time to be set via the select +updown/keys on the remote.
Allow an alarm to be configured by a config.ini file. The config file can

  •  Specify a time for the alarm.
  •  Specify an action for the alarm (The action is run when the alarm happens)
  •  The action can be 
         -Play a sound (or music file)
         -Play a user or defualt bodycon
         -Display an image.

In fact I have made it so any type of action can be added to the inifile. Basically if you can make it happen by running one of the robot scripts or programs, then you can run it as an alarm action. (so things like play a movie, take a photo, record a sound, enter guard mode should all be possible!!)

Here is an example of the config file:-

#
# Config.ini
#ini file for RSMedia Alarm Clock

[alarm1]
#specify time as hh:mm for 24 hour time or hh:mm[am][pm] for 12 hour time
time = 12:05am
action = SOUND:/mnt/sd/Personalities/female/Sounds/STOP01.mp3
snooze = 10
enabled = 1
volume = 100

[actioncmds]
SOUND = /usr/bin/robot/audioplayer -f
IMAGE = /usr/bin/robot/scripts/display_image.sh -f
DEFBC = /usr/bin/robot/scripts/DefaultBcon.sh
# end of file

So the config file part is all working well now. So the program can now set the time and alarm, a timer is set for the alarm and when the timer expires will play a sound or a bodycon or image.

But I have a few issues -
*to make the bodycon work the bot has to be in contorl mode, but for the keys to work the bot has to be in media mode!!
*Since the robots programs are still all running , he also goes into lowpower mode, so the screen turns off (pressing a remote button brings the screen (and clock) back.  
 *If the remote is used to change modes then the clock is not drawn anymore :-(

I will have a go at fixing some of these before I release the source and executable.  If I get stumped, I'll release it anyway and maybe someone else can help!!
(I've got some code clean up and documention to do as well :-(. )

Cheers

   Helibot

FreddyA
FreddyA's picture

That is an outstanding update! What else can be said, "WOWWEE HIRE HELIBOT FOR FUTURE ROBOT DEPLOYMENT". Threre is life for the RS Media and they (wowwee) should officially support updates and new programs for this robot. Helibot, you have made something some said could not be done and made it a reality. Many thanks for this incredible update.

Questions:
1. Do you start the program from command line, from the games menu or have you made a new option in the tools menu?

2. Will we see onscreen options for a "choose alarm type" Bodycon, audio file, video file, record sound memo, record video memo, record video motion (dream), Guard mode, track and video human and so on..

3. You have skillz, have you submitted an application to wowwee?

Nocturnal
Nocturnal's picture

Helibot said: If the remote is used to change modes then the clock is not drawn anymore :-(

And it doesn't come back again when the minute changes (and presumable refreshes the display)? How are you writing to the LCD?

Helibot
Helibot's picture

Hi Nocturnal,
Its a Nano-X application - Ie I'm creating a window in Nanox and adding myself to to top of the window stack (ie my window gets focus and can draw.) But if the bot changes mode , it creates new windows and my widnow loses focus.
I can probably fix this by recreating myself as top window again, But I would like to find a nice way to integrate into the Robot apps. Ie so the Robot can still be used as well. I think the easiset maybe to have a user bodycon that brings the clock to the front.
Cheers
Helibot

Nocturnal
Nocturnal's picture

Not that I have any experience with Nano-X, but I don't suppose a GrRaiseWindow(wid) call when the minutes tick over would work. If that works, you could also use a GrLowerWindow(wid) call to drop it back into the background after say 5 seconds.

Helibot
Helibot's picture

Hi Nocturnal,
Yep, that may help, although I think when the bot changes mode he may create a multiple windows, so maybe multiple GrRaiseWindow(wid) may be needed. I'll check it out.
Cheers
Helibot

Helibot
Helibot's picture

Hey FreddyA,
Thanx very much for the praise!! I think this could be the start of some great programs for the RSMedia (I have hopes that we can extend this framework to provide a different 'main program' for the robot that may give more flexibility (and intelegence ?!?!) to the robots actions and reactions!!....)

Questions:
1. Do you start the program from command line, from the games menu or have you made a new option in the tools menu?
Answer - You will be able to start it from the command line or a bodycon script. I cannot integrate it into the menus. (We would need the source for the main_UI program todo that). It is not using java (I think the games would just be for java programs), it is using C and creating a new window type program that runs in parallel with the robot window programs. The windowing system used in RSMedia is called Nano-X. It is a cut down version of X-Windows as used by linux.

2. Will we see onscreen options for a "choose alarm type" Bodycon, audio file, video file, record sound memo, record video memo, record video motion (dream), Guard mode, track and video human and so on..
Answer - Nope - this version reads all the config data from the config.ini file. This file will need to be edited on a PC and transferred to the robot - probably on the SDCard. When the progam starts it will read all the config data , then display the time and set a timer for the alarm. The digits & text on the clock are updated every minute. Thats all it can do.... for the moment...but we could extend the program, or create another program to create the ini file. - That for rsmalarmclock V2!!

3. You have skillz, have you submitted an application to wowwee?
Would be a cool job... dont know whether they would let me work from Australia though!!

Cheers
Helibot

TikaC
TikaC's picture

I vote for Helibot to work for WowWee. He'd bring to them better bot ideas too! :) Seriously, that would be an awesome dream! Good to see the alarm clock is coming along.

Pages