Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.

GRiSP Hackathon

Michal Slaski edited this page Mar 13, 2019 · 5 revisions

Problem description

In the winter months farmers keep their seedling in the greenhouse to begin the incubation period as early as possible. During these months it is extremely important to maintain a stable temperature and humidity within the greenhouse, so that the growth process is as effective as possible. The sooner a farmer can sell his agricultural yields, the higher price he can get. In the summer time prices drop as many farmers harvest their crops and there is a large supply of goods on the market.

After summer it is beneficial for farmers to preserve the harvested greens as long as possible, because in winter times prices of green-stuff raise again due to high demand and decreasing supply.

tunel rozsadowy w Wawrzeńczycach

In the village of Wawrzeńczyce farmers keep their seedlings in tunnels like the one in the picture. The temperature should never drop below 0°C, which is a big risk for proper growth. Harvested plants, on the other hand, should be stored in the optimal temperature of 5.5°C. Lower or higher temperatures can damage the greens and reduce its quality.

Hackathon goals

Design and implement a product, which helps farmers monitor their greenhouse and storehouse. Farmers should be able to see historical temperature and humidity levels. Farmers should note variations in temperature levels.

Technologies and limitations

The product can be based on the GRiSP board and its temperature/humidity modules. The GRiSP board does not have RTC, but it has a WiFi module. Farmers have Android smartphones, which can be used to display the user interface. Electricity is available in both greenhouse and storehouse, but network coverage may be limited to GSM network only.

First steps

  • clone the repo :)
  • install GRiSP Plugin;
  • add your IP and hostname to $REPO/grisp/grisp_base/files/erl_inetrc;
  • change hostname in grisp/grisp_base/files/grisp.ini.mustache;
  • add the network SSID and the password to $REPO/grisp/grisp_base/files/wpa_supplicant.conf;
  • deploy on SD card:
rebar3 grisp deploy --relname rolnik --relvsn 0.1.0
  • put SD card into GRiSP board, plug it into your macbook and press reset button;
  • connect over serial to find out GRiSP's IP;

Remote shell:

  • add GRiSP's IP and hostname to your /etc/hosts file;
  • start remote shell:
erl -sname my_remote_shell -remsh name@board -setcookie cookie
  • to load modules start another shell in $REPO directory:
rebar3 as test shell --sname my_dev_node --setcookie cookie
(my_dev_node@Host)3> r3:do(compile).
Verifying dependencies...
Compiling grisp
Compiling my_project
ok
(my_dev_node@Host)4> nl(my_module).

Example

Simple example with the use of ds18b20 thermometer can be found in $REPO/src/rolnik_example.erl. Functions for reading temperature/humidity via ds18b20 (one wire) or Pmod Hygro (i2c) are provided in $REPO/src/rolnik_device.erl file.

Useful links:

Examples from 2018 School of Erlang:

Clone this wiki locally