Local Farmbot Software

Hello all,

I am a mechatronics engineering student at Vance Granville Community college. We are interested in building a farmbot for educational purposes and also setting up a local server for the application. I have experience with linux software including fedora and red hat as I used to work as a support engineer for redhat briefly. I was wondering if there would be a way to host the application from a fedora server and if anyone would have any information on helping me figure that out.

Would it be easier just down create an Ubuntu server? Even still I would need some guidance in setting up the application locally since I have no experience with ubuntu. I’ve done some research and was reading how openshift may be a solution but I have never worked with openshift either

I would greatly appreciate any advice.

Thanks a lot!

That would be a question for this man http://forum.farmbot.org/users/rickcarlino/activity he’s the lead software developer for farmbot.

Hi, @PeterMarcellas

I would highly recommend against using anything other than Ubuntu- we simply haven’t tested against anything else and don’t have plans to support other distros on the server side. That’s not to say it’s impossible to use Fedora, it simply means that we can’t provide many resources for support if something goes wrong.

Can you try setting up the server using the instructions below?

https://github.com/FarmBot/Farmbot-Web-API/ under DEPLOYMENT.md

If you have any issues, I would appreciate if you could raise an issue on the GitHub issue tracker rather than on the forum. This helps us keep documentation up to date for future developers who are in the same position.

I wish you the best of luck on the server setup! Let us know how it goes.

A post was split to a new topic: Status Ticker Log Message Colors

Hi Rick,

I am currently looking into hosting the farmbot software on my own server, once mine arrives :slight_smile: :seedling:
Am I right by assuming that I would only need to install the farmbot-web-api? What about the web frontend?
Is there anything that I would not be able to do (e.g. access openfarm information?) if I host the service on my server?

Thanks a lot, best
Klim!

@Klimbim

Am I right by assuming that I would only need to install the farmbot-web-api

Correct. If you follow the setup instructions all of the required dependencies (such as the frontend) will be installed.

Is there anything that I would not be able to do (e.g. access openfarm information?)

If you are running the server on a LAN that does not talk to the outside world, you are correct, OpenFarm data will not be available. Completely offline setups are not a use case we actively test against, and we recommended most users use the public servers. Let us know if you hit any issues.

If I would open up the connection to the internet, pictures and my crop database would be saved on my server, but it would receive the openfarm data?

Hey @Klimbim,

had a short look in the code…

It depends :wink: This feature is handled by the Farmbot-Web-API and it’s fully up to you wether you want to store them locally or in the google cloud storage.

Correct! You can host it by yourself if you want, right now openfarm.cc is hardcoded in the webapp. But to be honest, i can’t see a reason why one should not use the public openfarm api?

Chris

The only thing why I would not be able to use openfarm, is if I would run the bot without internet connection. But I did not foresee that at the moment.

Where do I say that the software needs to connect to my server rather than to farmbot.io servers? I am missing that in the software documentation…

This should do the trick!

@livingst0n @Klimbim When you run WiFi configuration on your bot, click the “gear” icon on the “WEB APP” panel and use your own servers IP address instead of my.farmbot.io.


I just tried to run a server completely offline this morning. It is “somewhat” possible, but we need to make some changes to the codebase to fully support offline setups. The main issue is the OpenFarm search that you mentioned. For now, you can get around this by temporarily connecting your LAN to the internet while you add plants and then going offline. We will need to spend some time working on a more permanent fix, as this is obviously less than ideal, but it should get the job done for now.

2 Likes

Hi all,
just going through the reader of the farmbot web app.
Setup step 8:
MQTT_HOST=your_mqtt_server_domain rails
Which domain should i enter here? Does this MQTT server thing run on the local server as well? Do I need to enter the official farmbot server?

Thanks, Best
Klim

You will need to run an MQTT server inside of your LAN.

MQTT_HOST would refer to the IP address of the machine running the MQTT software.

Hi Rick,

I tried to set up the server with your and the farmbot europe wiki:
http://www.farmbot.wiki/index.php?title=Software_installation, look at the server section, which I got from @Freudenfranz
via Slack. As my linux skills are not the best (yepp great thing to start setting up your own server then :smiley:) I am stuck with the rake db:create:all db:migrate db:seed command which gives me rake aborted! bla bla.

What would be the best way to continue, could I somehow contribute and compile / edit / set up a step by step guide?

Any ideas? :slight_smile:

Hi @RickCarlino me again,
sry for being so impatient. I figured out some of the things, and stuck with installing the web frontend.
It says:

> npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
> npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.1
> npm WARN @blueprintjs/core@1.16.0 requires a peer of react-addons-css-transition-group@^15.0.1 || ^0.14 but none was installed.
> npm ERR! Linux 4.8.0-51-generic
> npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
> npm ERR! node v4.2.6
> npm ERR! npm  v3.5.2
> npm ERR! file sh
> npm ERR! code ELIFECYCLE
> npm ERR! errno ENOENT
> npm ERR! syscall spawn

> npm ERR! node-sass@3.13.1 install: `node scripts/install.js`
> npm ERR! spawn ENOENT
> npm ERR! 
> npm ERR! Failed at the node-sass@3.13.1 install script 'node scripts/install.js'.
> npm ERR! Make sure you have the latest version of node.js and npm installed.
> npm ERR! If you do, this is most likely a problem with the node-sass package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR!     node scripts/install.js
> npm ERR! You can get information on how to open an issue for this project with:
> npm ERR!     npm bugs node-sass
> npm ERR! Or if that isn't available, you can get their info via:
> npm ERR!     npm owner ls node-sass
> npm ERR! There is likely additional logging output above.

> npm ERR! Please include the following file with any support request:
> npm ERR!     /tmp/farmbot_frontend/npm-debug.log

> > farmbot-web-frontend@1.1.0 build /tmp/farmbot_frontend
> > node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details

> /usr/bin/env: ‘node’: No such file or directory

> npm ERR! Linux 4.8.0-51-generic
> npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
> npm ERR! node v4.2.6
> npm ERR! npm  v3.5.2
> npm ERR! file sh
> npm ERR! code ELIFECYCLE
> npm ERR! errno ENOENT
> npm ERR! syscall spawn
> npm ERR! farmbot-web-frontend@1.1.0 build: `node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details`
> npm ERR! spawn ENOENT
> npm ERR! 
> npm ERR! Failed at the farmbot-web-frontend@1.1.0 build script 'node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details'.
> npm ERR! Make sure you have the latest version of node.js and npm installed.
> npm ERR! If you do, this is most likely a problem with the farmbot-web-frontend package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR!     node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details
> npm ERR! You can get information on how to open an issue for this project with:
> npm ERR!     npm bugs farmbot-web-frontend
> npm ERR! Or if that isn't available, you can get their info via:
> npm ERR!     npm owner ls farmbot-web-frontend
> npm ERR! There is likely additional logging output above.

> npm ERR! Please include the following file with any support request:
> npm ERR!     /tmp/farmbot_frontend/npm-debug.log[/details]

sudo apt-get install npm
npm is already the newest version (3.5.2-0ubuntu4).

sudo apt-get install nodejs
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1).

/tmp/farmbot_frontend/npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/nodejs’, ‘/usr/bin/npm’, ‘run’, ‘build’ ]
2 info using npm@3.5.2
3 info using node@v4.2.6
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info lifecycle farmbot-web-frontend@1.1.0~prebuild: farmbot-web-frontend@1.1.0
6 silly lifecycle farmbot-web-frontend@1.1.0~prebuild: no script for prebuild, continuing
7 info lifecycle farmbot-web-frontend@1.1.0~build: farmbot-web-frontend@1.1.0
8 verbose lifecycle farmbot-web-frontend@1.1.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle farmbot-web-frontend@1.1.0~build: PATH: /usr/share/npm/bin/node-gyp-bin:/tmp/farmbot_frontend/node_modules/.bin:/home/klimbim/.rvm/gems/ruby-2.3.3@farmbot-web-app/bin:/home/klimbim/.rvm/gems/ruby-2.3.3@global/bin:/home/klimbim/.rvm/rubies/ruby-2.3.3/bin:/home/klimbim/.rvm/bin:/home/klimbim/bin:/home/klimbim/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle farmbot-web-frontend@1.1.0~build: CWD: /tmp/farmbot_frontend
11 silly lifecycle farmbot-web-frontend@1.1.0~build: Args: [ ‘-c’,
11 silly lifecycle ‘node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details’ ]
12 info lifecycle farmbot-web-frontend@1.1.0~build: Failed to exec build script
13 verbose stack Error: farmbot-web-frontend@1.1.0 build: node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details
13 verbose stack spawn ENOENT
13 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:17:16)
13 verbose stack at emitTwo (events.js:87:13)
13 verbose stack at ChildProcess.emit (events.js:172:7)
13 verbose stack at maybeClose (internal/child_process.js:821:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid farmbot-web-frontend@1.1.0
15 verbose cwd /tmp/farmbot_frontend
16 error Linux 4.8.0-51-generic
17 error argv “/usr/bin/nodejs” “/usr/bin/npm” “run” "build"
18 error node v4.2.6
19 error npm v3.5.2
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error farmbot-web-frontend@1.1.0 build: node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details
24 error spawn ENOENT
25 error Failed at the farmbot-web-frontend@1.1.0 build script ‘node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details’.
25 error Make sure you have the latest version of node.js and npm installed.
25 error If you do, this is most likely a problem with the farmbot-web-frontend package,
25 error not with npm itself.
25 error Tell the author that this fails on your system:
25 error node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js --display-error-details
25 error You can get information on how to open an issue for this project with:
25 error npm bugs farmbot-web-frontend
25 error Or if that isn’t available, you can get their info via:
25 error npm owner ls farmbot-web-frontend
25 error There is likely additional logging output above.
26 verbose exit [ 1, true ]

Anything which I can provide to you?
Wrong place to post? Github? How?

Cheers & Thanks
Klim

You should create a new Issue at the appropriate GitHub repository.

@Klimbim: the Install script expects that nodejs is available as “node”. But on your system it is installed as “nodejs”. So, please try this:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Chris

@Klimbim You are more than welcome to update the documentation on Github and submit a pull request if you think it will help other developers.

In the future, it would be best to move advanced software discussions to Github rather than the forum, since most software developers are in the habit of searching issues on Github.

Thank you very much @volkc, that made my day :smiley:

@RickCarlino: Would you want me to open an issue to discuss how I can enter usernames and passwords into the webfronend to get it running? I manage to connect to the start page on the local machine…
Sry for asking silly questions maybe, but this is definitely not my daily profession… :blush:

@Klimbim If you are on a local setup you will need to do the following:

  1. Enter your username and password.
  2. Press the “+” icon above the login page.
  3. Enter server IP address and port (Do not use localhost for any step of server setup- use the machine’s real IP)

Hope that helps! If you need any further assistance, let’s move the discussion to Github.