diff --git a/README.md b/README.md index f48758b..9e56ce8 100644 --- a/README.md +++ b/README.md @@ -193,14 +193,6 @@ armstub=armstub8-gic.bin enable_uart=1 ``` -Then enable the `ntpd` and `ntpdate` services to sync with the RTC on boot and -periodically: - -```sh -service ntpd enable -service ntpdate enable -``` - If you want, you can also change the `root` password at this point: ```sh @@ -214,7 +206,15 @@ sysctl dev.ds3231.0.temperature dev.gpioths.0.temperature ``` If you get a warning about an unknown oid, it means that the sensor is not -installed or configured correctly. +installed or configured correctly. The following commands can help in debugging +the problem. For example, if the battery in the DS3231 has gone bad, the above +command will show no error, however, the below command will print a warning +message. + +```sh +dmesg | grep -i ds3231 # for ds3231 debugging +dmesg | grep -i gpioths # for temperature sensor debugging +``` It should be noted that FreeBSD does not currently support wireless on the Raspberry Pi 4 at the time of writing. Thus, you will need to use a wired @@ -242,6 +242,15 @@ tar xf main.tar.gz cd rpi4b-temp-humidity ``` +If you do plan on connecting the device to the internet long term (remember to +arrange for it to be updated!!!), you can enable the ntpd and ntpdate services +to sync with an NTP server. + +```sh +service ntpd enable # sync periodically +service ntpdate enable # sync on boot +``` + At this point, take a moment to edit the `config.mk` file to to change any default options. These can also be changed after installation by editing `/usr/local/etc/rpi4b-temp-humidity/config.conf`. @@ -290,5 +299,31 @@ The buttons from closest to the display to farthest are: select, back, up, and down. When the device first turns on, the stats screen will be shown. This screen displays the current temperature, humidity, and time. Pressing the back button will take you to the main menu. The following is a short description of each screen: -- "Stats by" screen shows stats by a specific period (e.g. hour, day, week) -- + +- *Current stats* - the current time, temperature, and humidity +- *Stats by* - show stats by a specific period (e.g. hour, day, week). Press + the select button while on a stats screen to cycle what is displayed. Use up + and down while on a stats screen to got to the next or previous period. +- *Data points* - view individual data points. Press up or down to go to the next + or previous data point. +- *Average range* - show stats between two times. This has the same controls as + the "Stats by" screen above. +- *Export* - export data to a plugged in USB drive. Only file-systems detected by + [fstyp(8)][11] are supported. If a drive with an unsupported file-system, or + no file-system, is selected, you will be prompted to format it as FAT32. +- *Blank display* - turn of the display. Press any button to cancel. You must + have specified a "bl_pin" in the config file. +- *Power options* - re-initialize the program, shutdown or reboot the device +- *View date/time* - show the current date and time down to the second +- *Set date/time* - set the current date and time. The time entered is in local + time. +- *Set timezone* - set the timezone. The prompts will guide you through creating a + timezone as described in [tzset(3)][12]. Another, possibly easier to + understand description can be found in the corresponding Linux man page + [tzset(3)][13]. +- *Clear data* - *DELETE ALL DATA* on the device. When the operation is complete, + the database will be empty. *NO BACKUP IS MADE* so be careful. + +[11]: https://man.freebsd.org/cgi/man.cgi?query=fstyp&manpath=FreeBSD+14.0-RELEASE+and+Ports +[12]: https://man.freebsd.org/cgi/man.cgi?query=tzset&manpath=FreeBSD+14.0-RELEASE+and+Ports +[13]: https://man.archlinux.org/man/tzset.3 diff --git a/src/main.c b/src/main.c index 7bb50ce..0ca7e05 100644 --- a/src/main.c +++ b/src/main.c @@ -10,8 +10,6 @@ #include "lcd.h" #include "util.h" #include "ths.h" -#include "button.h" -#include "menu.h" #include "config.h" #include "ui/screen.h" #include "ui/statsby.h" @@ -27,17 +25,13 @@ #include #include -#include #include #include -#include #include -#include #include #include #include #include -#include #include #include #include diff --git a/src/ui/blankscreen.c b/src/ui/blankscreen.c index 28e60b1..457a395 100644 --- a/src/ui/blankscreen.c +++ b/src/ui/blankscreen.c @@ -27,7 +27,7 @@ static bool blank_screen_dispatch(Screen *screen, Screen *blank_screen_new() { Screen *s = malloc_checked(sizeof(Screen)); - screen_init(s, "Blank Display", + screen_init(s, "Blank display", (ScreenDispatchFunc) blank_screen_dispatch, (ScreenCleanupFunc) free); return s; diff --git a/src/ui/datapoints.c b/src/ui/datapoints.c index 8dc02fb..32a170d 100644 --- a/src/ui/datapoints.c +++ b/src/ui/datapoints.c @@ -155,7 +155,7 @@ static bool data_points_screen_dispatch(DataPointsScreen *screen, SensorState *s DataPointsScreen *data_points_screen_new() { DataPointsScreen *s = malloc_checked(sizeof(DataPointsScreen)); - screen_init(&s->parent, "Data Points", + screen_init(&s->parent, "Data points", (ScreenDispatchFunc) data_points_screen_dispatch, (ScreenCleanupFunc) free); s->need_redraw = true; diff --git a/src/ui/screen.c b/src/ui/screen.c index e8ce3d0..b1aa39c 100644 --- a/src/ui/screen.c +++ b/src/ui/screen.c @@ -169,7 +169,7 @@ static bool stats_screen_dispatch(StatsScreen *screen, SensorState *state) { StatsScreen *stats_screen_new() { StatsScreen *s = malloc_checked(sizeof(StatsScreen)); - screen_init(&s->parent, "Current Stats", + screen_init(&s->parent, "Current stats", (ScreenDispatchFunc) stats_screen_dispatch, (ScreenCleanupFunc) free); s->last_humid = 0; diff --git a/src/ui/statsby.c b/src/ui/statsby.c index 990c56a..78e9a0b 100644 --- a/src/ui/statsby.c +++ b/src/ui/statsby.c @@ -215,7 +215,7 @@ static bool stats_by_screen_dispatch(StatsByScreen *screen, StatsByScreen *stats_by_screen_new() { StatsByScreen *s = malloc_checked(sizeof(StatsByScreen)); - screen_init(&s->parent, "Stats by...", + screen_init(&s->parent, "Stats by", (ScreenDispatchFunc) stats_by_screen_dispatch, (ScreenCleanupFunc) free); s->need_redraw = true;