Skip to content

Commit

Permalink
Merge pull request #13 from ecodina/docu
Browse files Browse the repository at this point in the history
Docu
  • Loading branch information
ecodina authored May 15, 2022
2 parents 619193a + f7c52fa commit 3dd7cfc
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ During 2020's summer I decided it would be interesting to have my Hunter Pro-C w

It can control up to 48 zones and 4 programs.

A quite extensive documentation is available inside the [docs](docs) folder.
A quite extensive documentation is available on [this webpage](https://ecodina.github.io/hunter-wifi).

## Compatible devices

Expand Down Expand Up @@ -43,7 +43,7 @@ Feel free to fork this project and improve it. Some things that would be good to
Given that [Sebastien](https://github.com/seb821/OpenSprinkler-Firmware-Hunter) published his code under the GNU GPL v3, this project follows the same license.

Hunter Roam - WiFi
Copyright (C) 2020 Eloi Codina Torras
Copyright (C) 2020-2022 Eloi Codina Torras

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
7 changes: 7 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"additionalFooterText": "© Eloi Codina Torras ",
"anchorCharacter": "#",
"lineBreaks": "gfm",
"title": "Hunter WiFi",
"useSideMenu": true
}
212 changes: 212 additions & 0 deletions docs/index.html

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Welcome to Hunter-WiFi's documentation

During 2020's summer I decided it would be interesting to have my Hunter Pro-C watering system connected to the Internet. After some research I found [Scott Shumate 2015's product](https://www.hackster.io/sshumate/hunter-sprinkler-wifi-remote-control-4ea918), but it is no longer on sale. Luckily, [Sebastien](https://github.com/seb821/OpenSprinkler-Firmware-Hunter) published the necessary Arduino code. I have adapted his code to make it easier to control the sprinkler system.

It can control up to 48 zones and 4 programs.

## In this documentation

You can find:

* The HTTP API reference
* The MQTT API reference
* How to connect the device to the SmartPort
* How to build the project

## Compatible devices

I have only tried it on a Hunter Pro-C, but it should work with any Hunter product that is SmartPort (Roam) compatible. Basically, it needs a REM pin.
More information on [Hunter's webpage](https://www.hunterindustries.com/en-metric/irrigation-product/remotes/roam).

## Bill of materials

This project has been built for a [WeMos D1 Mini Pro](https://docs.wemos.cc/en/latest/d1/d1_mini_pro.html), but should be easily adaptable to any ESP8266 board.
You will also need a floating power source (e.g. mobile phone charger).
In total, you will spend ~10€ to give WiFi capabilities to your old Hunter.

## Try it yourself
Download this project and [upload it to your board](docs/1%20Build%20and%20upload.md). Afterwards, connect the microcontroller to the SmartPort (see how in the [docs](docs/2%20Connection%20to%20the%20SmartPort.md) folder).

The first time you power it, a "*WateringSystemAP*" open WiFi access point will be created. Connect to it and your phone will ask to "sign-in". Click on the notification and follow the steps to connect to your home WiFi. If nothing happens when you connect to the AP, navigate to 192.168.4.1.

When the board is connected to your home router, you will have an easy to use HTTP API (endpoints in the [docs](docs/3%20API%20reference.md) folder).

## Easy changes

You can change the AP's SSID and password-protect it by changing the values in `include/global_config.h`. You can also change the GPIO that connects to the REM pin of the Hunter system (by default, GPIO16 / D0).
50 changes: 50 additions & 0 deletions docs/navigation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
-- Name of your wiki
-- Do NOT remove the leading `#` character.
-->

# Hunter WiFi


<!--
-- Default theme
-- (Read: http://dynalon.github.io/mdwiki/#!customizing.md#Theme_chooser)
-->

[gimmick:theme](spacelab)


<!--
-- Navigation
-- (Read: http://dynalon.github.io/mdwiki/#!quickstart.md#Adding_a_navigation)
-->

[HTTP API reference](pages/api.md)
[MQTT API reference](pages/mqtt.md)

[How-Tos]()

* [Build and Upload](pages/buildupload.md)
* [Connect to the SmartPort](pages/hunterconnection.md)

[Go to GitHub](https://github.com/ecodina/hunter-wifi)

<!--
-- Change the Language
-- Could be useful when there's more than one language wiki.
-->

<!--
[Change the Language]()
* [English (United States)](/en_US/)
* [English (United Kingdom)](/en_GB/)
* [Italian](/it/)
-->

<!--
-- Let the user choose a theme
-- (Read: http://dynalon.github.io/mdwiki/#!quickstart.md#Adding_a_navigation)
-->

[gimmick:themechooser](Choose theme)
4 changes: 2 additions & 2 deletions docs/3 API reference.md → docs/pages/api.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# API Reference
# HTTP API Reference

This project provides an HTTP API to start and stop programs / zones.

Because of limitations in the chosen libraries, the API can only return whether it has correctly received the request. If you add a `result` parameter in your request, the board will send the result of parsing it and starting / stopping a zone or program to the URL you specify.

Note that Hunter's 1-wire protocol is write-only. Therefore, if the board returns that it started a program / zone correctly, it only means that there were no errors in the request and the program, but has no way of knowing if the Hunter Sprinkler System has actually done it. This limitation also means that the API cannot have a `status` endpoint.

## The `result` parameter
## The "result" parameter

If you add a `result` parameter in your request, the board will send a JSON to the webhook you specify containing:

Expand Down
1 change: 1 addition & 0 deletions docs/1 Build and upload.md → docs/pages/buildupload.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ If the above method didn't work or you want to make a few changes to the project
The `esp8266-hunter-sprinkler` folder is a PlatformIO project. Install Visual Studio Code (or any other IDE compatible with PlatformIO) and open the folder as a project.

After you make the changes, connect the board to your computer and upload it.

Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ This is the set up I currently have. You can use any mobile phone charger to pow

You will also need to connect the GPIO16 / D0 (if using the default installation) to the REM port.

The following diagram shows how to connect it. You can also [check a real photo of my setup](images/my-setup.jpeg).
The following diagram shows how to connect it. You can also [check a real photo of my setup](/hunter-wifi/images/my-setup.jpeg).

![Connection diagram](images/connection.png)
![Connection diagram](/hunter-wifi/images/connection.png)


## 2. Using the 24 VAC from the SmartPort

This should be the best option, as you wouldn't need an external power source.

However, I bought a 24 VAC to 5 VDC converter but, after many tries, I couldn't work out the connections.
However, I bought a 24 VAC to 5 VDC converter but, after many tries, I couldn't work out the connections.

Note! Check out [@gashtaan's comment](https://github.com/ecodina/hunter-wifi/issues/12#issuecomment-1082636694).
19 changes: 19 additions & 0 deletions docs/pages/mqtt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# MQTT API Reference

Hint: work in progress

## Endpoint to check in

hunter/device_hostname/checkIn --> will publish online/rebooted/reconnected/Dead Somewhere

## Endpoint to check the result

hunter/device_hostname/result --> will publish the same result json as the [rest api](/hunter-wifi/pages/api.md)

## Endpoint to start and stop a zone

hunter/device_hostname/zone/XXX --> commands the zone with json payload to be published by the user ( {"action": "start","time": "1"} -- {"action": "stop"} )

## Endpoint to start a program

hunter/device_hostname/program/XXX --> commands the zone with json payload to be published by the user ( {"action": "start"} )

0 comments on commit 3dd7cfc

Please sign in to comment.