Click here to go to the forum index Click here for the home page
 
Author Message

<  Firmwares, enhancements and upgrades  ~  Setting timers via SMS

Page 1 of 1
nwhitfield
Posted: Sat Jul 30, 2005 9:41 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
This is my current work in progress; the first stage is getting there, and I'd just like some input into the grammar for using it, ie the commands that you'd need to send to set a timer.

SMS messages need to start with a keyword; since I'm testing this, I don't have a unique keyword. Instead I'm using a sub-keyword on one of my SMS short names. That's not too important yet (until I ask other people to help test it). So, a message starts with the keyword, followed by a command to set something to record.

Let's assume the keyword is TOPPY RECORD (which it isn't, so don't waste your money texting!); at the moment, I have a simple system that understands, for example

TOPPY RECORD 5 2100 2200 CSI

ie the first item is the LCN, the next the start time, then the end time, then everything else is assumed to be the file name. This is correctly entered into a database on the web server as a one time record.

The second version is like this:

TOPPY RECORD 2 5 2230 2315 Newsnight

In this case, the second number is the number of times a week to record, so you set the repeat that way, ie 1 for weekly, 5 for weekdays, 2 for weekends, 7 for daily.

Do people think that makes sense?

And what about specifying things for other days? Most of the time, I imagine this is useful when you've gone out and forgotten to set a timer for a programme, so it'll probably be for today. So I'm thinking that perhaps all I need to do is allow an optional day of the week after the channel, like this:

TOPPY RECORD 5 fri 2000 2100 Stargate Atlantis

or

TOPPY RECORD 5 fri 1 2000 2100 Stargate Atlantis

Does that make sense to people? LCNs seem the best way to select channels, since on most mobiles you can enter numbers very easily in a text message. I'll work on an acknowledgment that uses the full name of a channel.

Ultimately, I could add shortcuts too, so you could have key programme names, like

TOPPY RECORD CSI
TOPPY RECORD CORRIE

and so on (but unlikely to be linked to real time info, at least initiallly; just shortcuts for the common times, ie 9pm on 5 for CSI).

So far, I have a script accepting the inbound messages in the first two formats I described, and storing them in a database, together with the number of the sending phone; that in theory allows people to access a list of their own timers via another web script, which I'll work on tomorrow. There could, of course, be different scripts depdending on the way you want to get your timers into the Toppy; as long as the data is in the database, it can be sent in any format you like.

Any and all comments welcome. And when I've done the download side of things, testers welcome - along with anyone who wants to do help with PHP code to format the data from the web server for however they'd like to import it to the Toppy.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
DB1
Posted: Sun Jul 31, 2005 11:47 am Reply with quote
Frequent contributor Joined: 30 Mar 2005 Posts: 728 Location: Orpington
You do think them up NIgel Smile I can access my home control system using DTMF tones - most modems that support voice/fax understand them - Wonder if that would work...............
View user's profile Send private message
nwhitfield
Posted: Sun Jul 31, 2005 2:35 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
Well, a little more tinkering, and I have a download script set up to produce output in the format for JAG's remote commands; one thing that I could see in the documentation was whether the channel numbers in that are for LCNs or not?

Now off to do some more testing...

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
nwhitfield
Posted: Sun Jul 31, 2005 2:59 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
Well, this is coming along nicely; a bit more tinkering before other people are welcome to join in (in particular, setting timers for other days isn't done yet), but the first two command formats I outlined work, and if you're using JAG's EPG, you just need these commands, or something similar, on the box that links to your Toppy to retrieve SMS-set timers and set them on the box:

Code:

wget http://www.toppy.org.uk/sms/jag.php/4479731000123/Jags_EPG.Command.ini
puppy -c put Jags_EPG.Command.ini '\ProgramFiles\Auto Start\Jags_EPG.Command.ini'


And hey, presto... you can now set timers on your Toppy when you're out and about, by sending a text message.

A few things to note, which I'll flesh out some more later. Timers are saved on the web server, and then new ones downloaded by your PC or Topfield gateway. You'll need a wake-up timer on the Toppy for the gateway or PC to be able to copy the timers over; you might want to do this a few times a day, or you might prefer to leave the Toppy on all the time.

This isn't something I'd call robust - for example, this morning I've not had any inbound requests accepted by the server from the SMS network; so I've had to do today's testing using manually created entries. But the guts of it are there, and it might even be useful to people one day.

If anyone wants to play with this, please let me know, and we can try to get a more polished solution.

And if anyone wants to have a bash at reformatting output from the system for a different uploader, like UK Timers, or EPG Uploader, you can happily have access to the script I did for JAG's, which is pretty clearly marked to show where you'd need to do things differently for other formats.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
Darkmatter
Posted: Sun Jul 31, 2005 3:30 pm Reply with quote
Forum moderator Joined: 21 Mar 2005 Posts: 1237
You may want to take a look at the .tgd file format ? that?s probably the most commonly used one. Also, I have it in the back of my mind that one of the transfer programs supports direct setting of timers. Can anyone fill in the detail?
View user's profile Send private message
nwhitfield
Posted: Sun Jul 31, 2005 7:03 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
I did think of using that one, for independence from the EPG. But my desire to get at least a proof of concept working won out over the need to set up a hideous looking mapping table in an ini file.

I'll get to it later - I've designed that I've done so far so that other downloader mechanisms can be catered for very easily.

Incidentally, I've seen somewhere (must update the PC software list with it) a 'Send to Toppy' applet for the PC (aha - http://members.optusnet.com.au/~toppytools/send2toppy.html ) which would be neat for some people too. I can't yet see a command line tool for sending a file over from the PC, but I'm sure there must be one somewhere, which would mean any internet connected PC could work with this too; it just needs to access a URL and then copy a file over.

With a bit of luck, the finished product will be pretty independent of both uploader and transfer method.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
nwhitfield
Posted: Sun Jul 31, 2005 10:45 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
OK; I now have this working for user's of Jag's EPG, with the first four command formats, and a simple download script that can be scheduled to run on a slug/Asus box.

It's happily picked up a timer I set from my mobile phone with the command

TOPPY RECORD 4 wed 2249 2256 Coldplay

There are some missing things at the moment; there are no acknowledgements sent back yet, since that costs money to send.

To expand on some of the features; if you don't specify a day in the command string, then a timer is set for either today or tomorrow. If the hour you specify for start is the same as the current hour (when received on the web server) or less, then the timer is set for tomorrow, otherwise it's for today.

So, you can't set a timer at 2005 for a programme that starts at 2050, but you could set one at 2050 for a programme that starts at 2100. I don't regard this as a major limitation - you need to set up a job to collect the timers, after all, and your Toppy has to be turned on to receive them too, so there's a bit of juggling going on.

If there's anyone who wants to play with this now that it's working, drop me a line. You'll need (for the moment) to be running Jag's EPG, and to have either a network connection to your Toppy, or a USB one.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
s7uar7
Posted: Sun Jul 31, 2005 11:01 pm Reply with quote
Frequent contributor Joined: 30 Mar 2005 Posts: 196 Location: Chalfont St Giles
How does the SMS get to your network? Presumably you need to sign up with some kind of message forwarding service and are given a unique number or keyword - does this cost much to set up and is there an extra charge for sending the SMS (on top of the normal SMS cost)?
View user's profile Send private message Visit poster's website
nwhitfield
Posted: Sun Jul 31, 2005 11:24 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
I use an SMS service called iTagg; you can get a basic tag for 9.99 a year, which is what we have for the web site. That gives you a keyword (like TOPPY) on a shared short code. You can forward messages via email, and send premium rate responses, which is how we do donations and competitions. Sending to the short code only costs the standard message fee.

Rather than use a basic tag, I'm using a full tag for this, which allows you to specify a URL that incoming messages will be POSTed to. There's also a URL-based API to send responses. A tag with those facilities costs more; I got one on special offer for 9.99 this year, but the usual price for one with access to that is about 99, so if I can get something polished enough for everyone to use, I'll probably register a dedicated tag to make it easier to use, and charge 25p (the minimum) per timer set, to try and recover the costs, though it would need about 1000 timers set that way to do that.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
maverick
Posted: Mon Aug 01, 2005 12:56 am Reply with quote
Frequent contributor Joined: 12 Jun 2005 Posts: 602 Location: Tunbridge Wells
Nigel,

To avoid the need to subscribe to an sms service, could you code it to read an sms sent as an email? I have seen this used to great effect in the fun (but pretty useless) Dittybot mac application at plasticbugs.com

John
View user's profile Send private message
nwhitfield
Posted: Mon Aug 01, 2005 10:19 am Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
Yes, it could do that. Just to be clear, the SMS service subscription is only needed once - just as I pay 9.99 a year for the TOPPY keyword, and anyone can send texts to it for the standard message price.

I could use the SMS to email forwarding options provided by various networks, so everyone could have their own method, but having a shortcode is the easiest option.

I've opted for the URL API based communication because I think it's more robust than email delivery (for which I'd still need to pay a subscription, albeit a smaller one), and because it offers the possibility of automatically acknowledging requests, which generally isn't something that the email route offers. I'd like, eventually, to be able to confirm back to people what they've set, for example.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
tichtich
Posted: Mon Aug 01, 2005 12:44 pm Reply with quote
Frequent contributor Joined: 08 May 2005 Posts: 1389 Location: Eastbourne, UK
nwhitfield wrote:
Well, a little more tinkering, and I have a download script set up to produce output in the format for JAG's remote commands; one thing that I could see in the documentation was whether the channel numbers in that are for LCNs or not?

They're the same channels numbers that Jag's EPG displays on the screen, so not LCNs.

_________________
Richard Wein
Firmware: 5.13.65 (patched). Auto Start TAPs: TapCommander 1.0.2, Power Down 0.6, DescriptionExtender 2.2, mei2archive 3.8I3, Automove 1.8, QuickJump 1.54, Improbox 2.1RC8, Jag's EPG 3.0b3 (TV & radio), Media Manager 1.5, MHEG Control A2g, Extend 1.7. PC apps: DGtoTop 1.1. Profile last updated 13/05/2009
View user's profile Send private message
nwhitfield
Posted: Mon Aug 01, 2005 1:25 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
OK; that makes things a little trickier, but not much; I'll just add a facility for the system to remember a channel mapping table so LCNs (which seems the most sensible thing to set a recording by) can be mapped to whatever is needed for the relevant uploader.

It's also, of course, going to be fairly trivial to add a web interface to let people set timers that way, instead of via SMS... so look for a few extras appearing in the Services section of the site!

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website
nwhitfield
Posted: Mon Aug 01, 2005 2:15 pm Reply with quote
Site Admin Joined: 20 Mar 2005 Posts: 9579
One SQL join later, and that's that problem sorted.

It will require people to choose a mapping table based on where they are, and how channels appear in the list; at the moment, I have that done for London, assuming you've not deleted any channels.

Nigel.

_________________
Support this site - make a donation to our running costs
View user's profile Send private message Visit poster's website

Display posts from previous:  

All times are GMT + 1 Hour
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum