Hi @RickCarlino
for some reason, nothing is happening if I enter every information and enter the IP adress of my local LAN
web frontend server and press submit configurationβ¦
How I can debug further?
Second question, if I open and log into the local webfrontend, is this what I should see? Without connected bot?
Ahm, could you please give us some further information about your setup?
(1) what have you done so far?
(2) some information about the server (OS/Hardware) could be useful
(3) are you using nginx/apache in front of nodejs?
(4) do you have any background on that stuff or is it more like trial/error or fire&forget
@volkc
thanks very much for your support, I appreciate it!!!
I guess what is really missing for the local installation is an overview of the components (software pieces)
which need to run together. At the moment it was only my brain which detected the software in use
because of the installation commands which are needed⦠I guess that this would help a lot even for
very experienced software cracksβ¦
edited config/application.yml to what I found most logic and appropriate
NO MQTT server installed yet
Status: Log in possible via web browser, but then see above
running the server currently manually with rails s -b IP
Client
downloaded latest FarmBot OS and installed on RP, works fine, the farmbot WiFi opens up
after entering connection details for WiFi, username and pw it would not let me enter the IP
of the local server; if I enter it and try to press βsubmit configurationβ nothing happensβ¦
if I leave the server field empty the raspi tries something but ends up with a reebot
(2) Setup hard/software
server running in LAN
ubuntu 16.04 running with standard installation
(3) are you using nginx/apache in front of nodejs?
not that I know of, I only installed nodejs
(4)
I think I have got basic knowledge but it is definitely try, see error, analyze and then
move on.
I would appreciate if I would know where to look in the logs for the server application as
well as the Raspi application. That would help a lot!
Thanks for your support again, looking forward to getting the thingi running this weekend!
Sry, but forget those installation instructions, theyβre incomplete and for me they look a little bit hacky. Beside that it would make some sense to document everything in our community wiki
Do you want to run that stuff on another PI? I will have some time at the weekend and could provide an image with everything installed. How does that sound?
I would appreciate to work on the right way to get it working in order to understand it. I think that I am almost there and it will need only some tweeks here and there.
I wanted to use the time and installed already the software on the Raspi
So if you could guide me to the solution for the server installation I would appreciate it. I would then edit the server installation instructions for the rest of the farmbot world
Please have a look at my application.yml config file. I only posted the uncommented lines,
as the forum seems to have problems with the # uncomment sign.
Cheers
ββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββ READ THIS BEFORE USING IT.
ββββββββββββββββββββββββββββββββββ SEE NOTES BELOW:
ββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββ
You will hit issues if any of these are set to the wrong value.
Please read each line of this file before starting the server.
=============================================================================
API_HOST: β0.0.0.0β
API_PORT: β3000β
DOCS: βSet this to any value if you want to generate API docs after running testsβ
DATABASE_URL: βpostgres://myuser:mypassword@127.0.0.1:5432/farmbot_developmentβ
DEVISE_SECRET: βUsed for devise. Use rake secret to generate a new value.β
FW_UPDATE_SERVER: βhttps://api.github.com/repos/FarmBot/farmbot-arduino-firmware/releases/latestβ
OS_UPDATE_SERVER: βhttps://api.github.com/repos/farmbot/farmbot_os/releases/latestβ
HEROKU_SLUG_COMMIT: βThis is set by Herok, used by Frontend to show current version.β
MQTT_HOST: β0.0.0.0β
NPM_ADDON: βUsed by FarmBot, Inc. to load proprietary extras, like Rollbar.β
SMTP_HOST: βsmtp.sendgrid.netβ
SMTP_PORT: 587
Actually- I should not assume that you are running on port 3000, sorry! Be sure to right the URL as http://192.168.0.38:XYZ where XYZ is the serverβs port number. On my local machine, it is port 300.
@RickCarlino
Fine is exxagerated, I am about to get it running on a very fragile setup
So I tried and it seem that the raspi connects to my WiFi, because I see a client with nerves-2644 connected assuming that this is the client because the bot sets up the farmbot-2644 netβ¦? Buuuut it does not connect to the server and reboots after some time and establishes its own config wifi againβ¦
Is there any possibility to debug (view logfiles) on the raspi in order to see what he did not like?
@Klimbim@RickCarlino Iβm trying to do a local install, got the mqtt gateway and Web API running on the same machine and they are talking togehter (which means API_HOST, API_PORT as well as MQTT_HOST are all set accordingly to a real IP and the used port number). I can also log into the WebApp and see in MQTT.fx when I try to send controls.
The one (and unfortunately most important) thing I canβt get to work is the local connection from the Farmbot to the WebApp/API. I used the credentials that i also use to login to the WebApp and for the Server URL I use http://<local IP mentioned before>:3000 and I can see something happening in the Farmbot terminal (namely FarmEvent Load three times) but the FarmBot wonβt show up in the WebApp as connected.
I initially tried the setup via https://my.farmbot.io which worked flawlessly, then I factory-reset the Farmbot and even reflashed the image but I canβt get the local setup to work.
Are you loading the web app from the same machine that runs that server?
Have you been able to open the web app from a machine other than the one that runs the server?
What do you see when you run git log -n 3? Please copy/paste it.
When you ran configurator, did you enter the info like this:
β¦but not like this?
Rails might not be binding to the correct network interfaces or only allowing connections from localhost, which means your browser can connect OK, but outside devices (like FarmBot) cannot.
Iβm loading the web app from another client, since the server is just a headless Ubuntu installation and I can enter from this other machine (Chrome and Firefox).
For the configurator I entered the real IP (tried, again, both Chrome and Firefox, but it didnβt connect anyways).
(How) can I force rails to listen on all interfaces/accept requests from all IPs?
I even cleared any iptables rules and disabled ufw, just to be sure and cause itβs only the internal network and the server is there for the sole pupose of running the WebApp and mqtt gateway.
One more, just to clarify: I start the Farmbot-Web-App with npm run dev and after that (always using another ssh session in another window) I start the mqtt gateway with WEB_API_URL=http://<Ubuntu server IP>:3000 npm start each from their respective folders that I cloned from Github. Right?
The -b 0.0.0.0 will force Rails to listen to all interfaces, but strangely, Procfile.dev is already set up to do that , leading me to believe it is a different issue.
Is it safe for me to assume all three machines (server, client, bot) are within the same LAN? Sometimes firewalls can get in the way- are there any external firewalls in place outside of ufw?
That is correct.
One last question:
Have you seen messages from the bot on MQTTfx at all? Or just messages from the browser? You should see them on channel bot/BOT_NAME/from_device. If you have never seen a /from_device message, it is probably just a wifi strength / connectivity issue. Temporarily hooking up to ethernet might be a good way to test this theory.
$ rails s -p 3000 -b 0.0.0.0
WARNING: Use strings for Figaro configuration. true was converted to "true".
=> Booting Thin
=> Rails 5.1.3 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
W, [2017-09-21T16:41:20.325744 #5995] WARN -- : [SKYLIGHT] [1.3.1] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
Thin web server (v1.7.2 codename Bachmanity)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
β¦and tons of output as soon as I log into the WebApp
Window 3:
$ rake jobs:work
WARNING: Use strings for Figaro configuration. true was converted to "true".
W, [2017-09-21T16:31:37.993886 #5756] WARN -- : [SKYLIGHT] [1.3.1] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
[Worker(host:<my_hostname> pid:5756)] Starting job worker
2017-09-21T16:31:38+0200: [Worker(host:<my_hostname> pid:5756)] Starting job worker
All devices are in the same LAN with no firewalls between them, all on the same switched network.
I performed a factory reset and connected the FarmBot via Ethernet now (ping is now <1ms, was ~4ms on WiFi before, so most definitely using Ethernet now), but I havenβt seen any messages from_devices yet (also not on WiFi before).
And you are running: /mqtt-gateway$WEB_API_URL=http://192.168.1.100:3000 npm start /Farmbot-Web-App$npm run dev
(Since you are running MQTT on the same server, you could probably just run npm start in /mqtt-gateway and npm run dev in /Farmbot-Web-App, but either approach should work.)
For SERVER during FarmBot OS configuration: http://192.168.1.100:3000.
After you have completed FarmBot OS configuration, if you restart MQTT at any point, you will need to power cycle your device to reconnect it to the app. When you do, do you see something like this in the terminal for the app? Started POST "/api/tokens" for . . . (thereβs a long string in the request, so it should be easy to spot)
If you donβt, the device isnβt connecting to the app, and will not connect to MQTT either. You should also see that POST after pressing SUBMIT during FarmBot OS configuration.
Good to know that a power cycle is necessary, I might not have been doing this every single time, but i will from now on.
Concerning the POST /api/tokens:
22:24:11 rails.1 | Started POST "/api/tokens" for <IP of the FarmBot> at 2017-09-21 22:24:11 +0200
22:24:11 rails.1 | Processing by Api::TokensController#create as JSON
22:24:11 rails.1 | Parameters: {"user"=>{"credentials"=>"< super long string ending with == >"}, "token"=>{"user"=>{"credentials"=>"< another long string ending with == >"}}}
22:24:11 rails.1 | User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["email", "bla@bla.com"], ["LIMIT", 1]]
22:24:11 rails.1 | Device Load (0.2ms) SELECT "devices".* FROM "devices" WHERE "devices"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]
22:24:11 rails.1 | [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.76ms)
22:24:11 rails.1 | Completed 200 OK in 84ms (Views: 3.9ms | ActiveRecord: 0.6ms)
I got this after I power cycle the FarmBot but not if I submit a new configuration, might the issue be therefore based around the configurator somewhere?