yun client reading url and write to alarm time

hello all,

im trying to make an alarm (in arduino sketch) with ability to set the alarm time via url.
i have this all working with serial input.
now i want to incorp that when i send a url like arduino.local/alarm1/12341234
then the alarmstart time will be 12:34
as wel als the alarmstop time.

im building on the TemperatureWebPanel sketch as the base.
the code i have so far are below.

  Temperature web interface

 This example shows how to serve data from an analog input
 via the Arduino Yún's built-in webserver using the Bridge library.

 The circuit:
 * TMP36 temperature sensor on analog pin A1
 * SD card attached to SD card slot of the Arduino Yún

 Prepare your SD card with an empty folder in the SD root
 named "arduino" and a subfolder of that named "www".
 This will ensure that the Yún will create a link
 to the SD to the "/mnt/sd" path.

 In this sketch folder is a basic webpage and a copy of zepto.js, a
 minimized version of jQuery.  When you upload your sketch, these files
 will be placed in the /arduino/www/TemperatureWebPanel folder on your SD card.

 You can then go to http://arduino.local/sd/TemperatureWebPanel
 to see the output of this sketch.

 You can remove the SD card while the Linux and the
 sketch are running but be careful not to remove it while
 the system is writing to it.

 created  6 July 2013
 by Tom Igoe

 This example code is in the public domain.


#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#include <Time.h>
#include <TimeAlarms.h>
// Listen on default port 5555, the webserver on the Yún
// will forward there all the HTTP requests for us.
YunServer server;

AlarmID_t alarmStart1, alarmStop1; //ID for interval licht

byte hourStart1 = 0;
byte minuteStart1 = 0;
byte hourStop1 = 0;
byte minuteStop1 = 0;

void setup() {

  // Bridge startup
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  digitalWrite(13, HIGH);

  // Listen for incoming connection only from localhost
  // (no one from the external network could connect)

  // get the time that this sketch started:
  alarmStart1 = Alarm.alarmRepeat(8, 27, 00, lichtStart); //==start alarm mode interval slave 1
  alarmStop1  = Alarm.alarmRepeat(8, 29, 30, lichtStop); //==stop alarm mode interval slave 1

void loop() {
  // Get clients coming from server
  YunClient client = server.accept();

  // There is a new client?
  if (client) {
    // Process request

    // Close connection and free resources.
  time_t t = now();
  Alarm.delay(1000); // wait one second between clock display

void digitalClockDisplay(time_t t)
  // digital clock display of the time

void printDigits(int digits)
  if (digits < 10)

//========================reading UNIX TIME==========================//
void process(YunClient client)
  // There is a new client?
  if (client) {
    // read the command
    String command = client.readString();
    command.trim();        //kill whitespace
    // is "temperature" command?
    if (command == "alarm1") {
//=========CHANGE ALARM data from SERIAL MESSAGE =========//
void setAlarm( time_t alarmNumber, time_t start, time_t stop)
  if (alarmNumber == 1)
    Alarm.disable (alarmStart1);
    Alarm.disable (alarmStop1); (alarmStart1); (alarmStop1);
    alarmStart1 = Alarm.alarmRepeat(start, lichtStart);
    alarmStop1  = Alarm.alarmRepeat(stop, lichtStop);


  Serial.print("Seting alarm ");
  Serial.print("Start:  ");
  Serial.print("Stop:  ");


void getNewAlarmTimesl(YunClient client)
  unsigned long startTime = millis();

    int value;
        value = client.parseInt();

  if ( == '/') {
    // Read value and execute command
    if (millis() - startTime > 1000)
      Serial.println("got header but timed out waiting for 8 bytes");
  //===========for ROOM 1===========
  hourStart1 = getIntFromAscii(2);
  minuteStart1 = getIntFromAscii(2);
  hourStop1 = getIntFromAscii(2);
  minuteStop1 = getIntFromAscii(2);

  //================================================================room 1
  time_t newStart, newStop, newInterval;

  newStart = AlarmHMS (hourStart1, minuteStart1, 0);
  newStop  = AlarmHMS (hourStop1, minuteStop1, 0);
  setAlarm(1, newStart, newStop);
  Serial.println (hourStart1);
  Serial.println (minuteStart1);


int getIntFromAscii(int nbrDigits)
  int val = 0;
  for (int i = 0; i < nbrDigits; i++) {
    val = (val * 10) + - '0';
  return  val;

/*==================== ALARM ROOM 1, START and STOP =================*/
void lichtStart() {
  Serial.println("LICHT AAN");
  digitalWrite(13, HIGH);
void lichtStop() {
  Serial.println("LICHT UIT");
  digitalWrite(13, LOW);

void showAlarmTime(AlarmID_t id)
  time_t alarmTime =;
  if (alarmTime != 0)
    if ( alarmTime <= SECS_PER_DAY)
      Serial.print(" repeat alarm with ID ");
      Serial.print(" once only alarm with ID  ");
    Serial.print(id, DEC);
    Serial.print(" set for ");

the problem with this sketch is that when i send only arduino.local/arduino/alarm1/, it sets the alarm tot 16:49start and 16:49 stop.

ps: im just a beginner, so please explain in kids languege.