A remote timer, equipped with a scheduling Web interface, controls a "DigitalOut".

Dependencies:   Timezone NTPClient

WebTimer

The WebTimer is an Mbed device enabling to remotely control a DigitalOut. It has a "calendar-like" user interface to edit the schedule - a table you can click on (or tap on a touch-screen device).
The program was ported to Mbed from the Tuxgraphics site. Thank you Guido for sharing!

  • When starting, it will print it's IP address over the USB serial link to the terminal screen. However, you can set a different static IP address if you modify the code in the main.cpp.
  • To connect to the WebTimer, type the IP address into the web browser edit box and hit ENTER.
  • When a cell is green then the timer keeps it's output ON during that period of time. If a cell is not green it means the output is OFF.
  • To select or deselect multiple cells you can click (keep down the button) and move the mouse over more cells.
  • The smallest time interval on this 24h timer is 15minutes.
  • To save the changes type in the password and hit ENTER or click on the Save button.
  • The default password is "secret". But you can change it by editing the source code in main.cpp.
OnDesktopOnPhone
Committer:
hudakz
Date:
Fri Nov 13 09:37:14 2020 +0000
Revision:
4:fe9189193dcd
Parent:
0:f78e57015038
A remote timer, equipped with a scheduling Web interface, controls a "DigitalOut".

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:f78e57015038 1 /*********************************************
hudakz 0:f78e57015038 2 * vim:sw=8:ts=8:si:et
hudakz 0:f78e57015038 3 * To use the above modeline in vim you must have "set modeline" in your .vimrc
hudakz 0:f78e57015038 4 * Author: Guido Socher
hudakz 0:f78e57015038 5 * Copyright: LGPL V2
hudakz 0:f78e57015038 6 * See http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html
hudakz 0:f78e57015038 7 *
hudakz 0:f78e57015038 8 * Some common utilities needed for IP and web applications.
hudakz 0:f78e57015038 9 * The defines below are controlled via ip_config.h. By choosing
hudakz 0:f78e57015038 10 * the right defines for your application in ip_config.h you can
hudakz 0:f78e57015038 11 * significantly reduce the size of the resulting code.
hudakz 0:f78e57015038 12 *********************************************/
hudakz 0:f78e57015038 13 //@{
hudakz 0:f78e57015038 14 #ifndef WEBSRV_HELP_FUNCTIONS_H
hudakz 0:f78e57015038 15 #define WEBSRV_HELP_FUNCTIONS_H
hudakz 0:f78e57015038 16 //#include "ip_config.h"
hudakz 0:f78e57015038 17 #include "stdint.h"
hudakz 0:f78e57015038 18
hudakz 0:f78e57015038 19 #define FROMDECODE_websrv_help
hudakz 0:f78e57015038 20 #define URLENCODE_websrv_help
hudakz 0:f78e57015038 21
hudakz 0:f78e57015038 22 #ifdef __cplusplus
hudakz 0:f78e57015038 23 extern "C" {
hudakz 0:f78e57015038 24 #endif
hudakz 0:f78e57015038 25
hudakz 0:f78e57015038 26 #ifdef FROMDECODE_websrv_help
hudakz 0:f78e57015038 27 // These functions are documented in websrv_help_functions.c.
hudakz 0:f78e57015038 28 // find_key_val searches for key=value pairs in urls, returns 1 if the key was found (may be empty string) and returns 0 if the key was not found:
hudakz 0:f78e57015038 29 extern uint8_t find_key_val(char *str,char *strbuf, uint8_t maxlen,char *key);
hudakz 0:f78e57015038 30
hudakz 0:f78e57015038 31 extern void urldecode(char *urlbuf); // decode a url string e.g "hello%20joe" or "hello+joe" becomes "hello joe"
hudakz 0:f78e57015038 32 #endif
hudakz 0:f78e57015038 33 #ifdef URLENCODE_websrv_help
hudakz 0:f78e57015038 34 extern void urlencode(const char *str,char *urlbuf); // result goes into urlbuf. There must be enough space in urlbuf. In the worst case that would be 3 times the length of str.
hudakz 0:f78e57015038 35 #endif
hudakz 0:f78e57015038 36 // parse a string that is an IP address and extract the IP to bytestr
hudakz 0:f78e57015038 37 extern uint8_t parse_ip(uint8_t *ip_byte_str,const char *str);
hudakz 0:f78e57015038 38 extern void mk_net_str(char *resultstr,uint8_t *ip_byte_str,uint8_t len,char separator,uint8_t base);
hudakz 0:f78e57015038 39
hudakz 0:f78e57015038 40 #ifdef __cplusplus
hudakz 0:f78e57015038 41 }
hudakz 0:f78e57015038 42 #endif
hudakz 0:f78e57015038 43
hudakz 0:f78e57015038 44 #endif /* WEBSRV_HELP_FUNCTIONS_H */
hudakz 0:f78e57015038 45 //@}
hudakz 0:f78e57015038 46