farmbot_os/README.md

138 lines
4.2 KiB
Markdown
Raw Normal View History

2016-08-28 21:48:00 -06:00
# FarmBot Software for the Raspberry Pi
2014-01-12 11:58:55 -07:00
The "brains" of Farmbot. Responsible for receiving the commands from users or the farmbot-web-app. It executes them and report back the results to any subscribed user(s).
2014-01-12 11:58:55 -07:00
Technical Stuff
---------------
2014-01-12 11:58:55 -07:00
2015-08-19 08:59:26 -06:00
* Written in Ruby.
* Operation scheduling data is stored in SQLite 3.
* Device status info, such as X, Y, Z and calibration data is stored via [PStore](http://ruby-doc.org/stdlib-1.9.2/libdoc/pstore/rdoc/PStore.html)
* Backups to the cloud provided by [Farmbot Web API](https://github.com/farmbot/farmbot-web-api).
* Messaging happens via [MQTT](http://mqtt.org/).
2015-08-19 08:59:26 -06:00
* Communicates with Arduino hardware using the [farmbot-serial gem](https://github.com/FarmBot/farmbot-serial)
2015-08-09 18:11:57 -06:00
Running in production
---------------------
2015-08-19 08:59:26 -06:00
```
bundle install
ruby farmbot.rb
```
Running on Local
----------------
2015-08-09 18:11:57 -06:00
If you're running your own local [farmbot web app](https://github.com/farmbot/farmbot-web-app)
2015-08-19 08:59:26 -06:00
`FBENV=development ruby farmbot.rb`
2015-08-09 18:11:57 -06:00
Installation on Raspberry Pi
----------------------------
2014-01-15 15:14:52 -07:00
Installation on a Raspberry Pi 3 will take about 30 minutes.
2016-08-28 21:36:12 -06:00
### Update the RPi
```
sudo apt-get update
```
### Install Ruby 2.2
This gem requires Ruby 2.2 minimum. Later versions will work fine as well. As of this writing, a Pi is loaded with 1.9.3 by default.
To remove the old version of Ruby that comes with most RPi distributions:
```
sudo apt-get remove ruby* --purge
```
To upgrade your ruby version, try this:
```
2016-03-30 06:09:04 -06:00
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -L https://get.rvm.io | bash -s stable --ruby
```
This will take about 2 hours a standard Raspberry Pi 2, or about 20 minutes on a Raspberry Pi 3.
### Clone, install and run
2014-01-15 15:14:52 -07:00
2016-08-01 14:30:13 -06:00
**NOTE:** We tag releases when they are stable. The latest version (on master) is not guaranteed to be stable.
See [releases](https://github.com/FarmBot/farmbot-raspberry-pi-controller/releases) to find a stable release.
**OPTION A:** For less stable "edge" version:
```
2016-08-01 14:30:13 -06:00
git clone https://github.com/FarmBot/farmbot-raspberry-pi-controller
```
**OPTION B:** For stable release 1.1:
```
git clone -b 'alpha-1.1' --single-branch https://github.com/FarmBot/farmbot-raspberry-pi-controller
```
2014-01-15 15:14:52 -07:00
**REQUIRED FOR EITHER:** (takes about 10 minutes on an RPi 3)
```
2014-05-19 01:59:58 -06:00
cd farmbot-raspberry-pi-controller
gem install bundler
bundle install
2015-09-01 14:47:21 -06:00
rake db:setup
```
#### Set up the device:
Go to the [My Farmbot Website](http://my.farmbot.io) (or your private server) and sign up for a Farmbot account.
Then from within the `farmbot-raspberry-pi-controller` project directory run:
```bash
ruby setup.rb
```
#### Report problems:
We can't fix issues we don't know about. If you are having issues with setup, please [raise an issue with us](https://github.com/FarmBot/farmbot-raspberry-pi-controller/issues/new). This helps us identify confusing steps, common setup issues and other problems.
2014-01-15 15:14:52 -07:00
Arduino
-------
You will need to flash your Arduino with custom firmware. For instructions on how to do this, see [the FarmBot-Arduino github page](https://github.com/FarmBot/farmbot-arduino-firmware)
2014-10-19 13:15:07 -06:00
Contributors
2016-03-27 07:57:56 -06:00
-------
2014-02-13 14:04:39 -07:00
See full list [here](https://github.com/FarmBot/farmbot-raspberry-pi-controller/graphs/contributors).
2014-02-13 14:04:39 -07:00
License
-------
The MIT License
Copyright (c) 2016 Farmbot Project
2014-01-15 15:14:52 -07:00
2014-02-13 14:04:39 -07:00
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
2014-01-15 15:14:52 -07:00
2014-02-13 14:04:39 -07:00
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
2014-01-15 15:14:52 -07:00
2014-02-13 14:04:39 -07:00
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.