currently I’m trying to setup an offline Farmbot configuration. I followed the instructions on github concerning the installation of the Web-App and got it working with the configuration file you can see below.
The current network setup is all wired and consists of a Router (192.168.0.1), the Farmbot (using dhcp, usually 192.168.0.2) and an Ubuntu Server (192.168.0.5). The server api output shows only “Completed 200 OK” messages after connecting to mqtt. Adding another PC and connection to the Web-Api-Interface from there works fine.
After configuring the Farmbot to use Ethernet, username farmbot-test2@test.com and the server http://192.168.0.5:3000 it connects fine to the network (i can successfully ping it), but it never shows up as a device in the Web-App (the according entry in the devices table is also only consiting of the default values (id, name, 100, 100), the rest is empty.
Executing store.getState().auth.token.unencoded in the browser returns
My config/application.yml without the commented lines
API_HOST: "192.168.0.5" API_PORT: "3000" DOCS: "Set this to any value if you want to generate API docs after running tests" DEVISE_SECRET: "d6feb2d6722184b922c3e303fa08963b46cd9f78ced9469563237340652183af79beaa4962da9006a818a212dbee24663efaf9933385eb36c1c4717bf88e0bd9" OS_UPDATE_SERVER: "" MQTT_HOST: "192.168.0.5" SENDGRID_PASSWORD: "Used by FarmBot, Inc" SENDGRID_USERNAME: "Used by FarmBot, Inc" SMTP_HOST: "smtp.sendgrid.net" SMTP_PORT: "587" NO_EMAILS: "TRUE" MQTT_VHOST: "/" RUN_CAPYBARA: "true" RAILS_ENV: "development" ADMIN_PASSWORD: "farmbot"
What does the connectivity panel show on the web app? I suspect something in your rabbitmq setup isn’t working properly. Have you tried using my.farm.bot as a test to make sure your network is configured correctly?
Now when I connect to the Internet and change the IP Addresses in config/application.yml and the Farmbot configuration accordingly, the Farmbot connects and syncs. Note: I still use my local Web-App IP address in the Farmbot configuration
Here’s the mqqt output
W, [2018-08-24T08:36:13.047373 #13327] WARN -- Skylight: [SKYLIGHT] [2.0.2] 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'.) === Retrieving container info === Setting config data === Stopping pre-existing farmbot containers cd mqtt && sudo docker stop aaecff6dc2f1 aaecff6dc2f1 cd mqtt && sudo docker rm aaecff6dc2f1 aaecff6dc2f1 === Destroying old docker images cd mqtt; sudo docker rmi farmbot-mqtt --force Untagged: farmbot-mqtt:latest Deleted: sha256:4a7319927bb2fec5ec638af06518309379ffae67248895e918d3a834feafd893 Deleted: sha256:061a1f08d25c329aea922ca62bb85c7b1975f45ad7f2d8508fef398b3dd6cec8 Deleted: sha256:dc9b8954ebaeae05943be7386a875c4e373ce7316adf6e1de44c2343afb65e95 Deleted: sha256:90bbc7b510986f8cfeb8777080bf6c8ffcc8f62bab16253fc9d391b0f3c28284 Deleted: sha256:ae77512ea43d7486f2a842bb818582422a88d168fbe515ff954dbab79759aa4f === Building docker image cd mqtt; sudo docker build -t farmbot-mqtt . Sending build context to Docker daemon 7.68kB Step 1/4 : FROM rabbitmq:3.7.6 ---> 35f7711c9faf Step 2/4 : ADD ./rabbitmq.conf /etc/rabbitmq/ ---> Using cache ---> 2d9dafbd76da Step 3/4 : RUN rabbitmq-plugins enable --offline rabbitmq_auth_backend_http rabbitmq_management rabbitmq_mqtt rabbitmq_auth_backend_cache rabbitmq_web_mqtt ---> Running in bbc96d99c714 The following plugins have been configured: rabbitmq_auth_backend_cache rabbitmq_auth_backend_http rabbitmq_management rabbitmq_management_agent rabbitmq_mqtt rabbitmq_web_dispatch rabbitmq_web_mqtt Applying plugin configuration to rabbit@bbc96d99c714... The following plugins have been enabled: rabbitmq_auth_backend_cache rabbitmq_auth_backend_http rabbitmq_management rabbitmq_management_agent rabbitmq_mqtt rabbitmq_web_dispatch rabbitmq_web_mqtt set 7 plugins. Offline change; changes will take effect at broker restart. Removing intermediate container bbc96d99c714 ---> bf9a1d66860c Step 4/4 : CMD ["rabbitmq-server"] ---> Running in ebbd709dda1b Removing intermediate container ebbd709dda1b ---> da859ed44bfc Successfully built da859ed44bfc Successfully tagged farmbot-mqtt:latest === Starting MQTT 2018-08-24 06:36:39.928 [info] <0.33.0> Application lager started on node rabbit@33a3495f2088 2018-08-24 06:36:40.678 [info] <0.33.0> Application mnesia started on node rabbit@33a3495f2088 2018-08-24 06:36:40.679 [info] <0.33.0> Application crypto started on node rabbit@33a3495f2088 2018-08-24 06:36:40.679 [info] <0.33.0> Application jsx started on node rabbit@33a3495f2088 2018-08-24 06:36:40.679 [info] <0.33.0> Application xmerl started on node rabbit@33a3495f2088 2018-08-24 06:36:40.694 [info] <0.33.0> Application os_mon started on node rabbit@33a3495f2088 2018-08-24 06:36:40.785 [info] <0.33.0> Application inets started on node rabbit@33a3495f2088 2018-08-24 06:36:40.786 [info] <0.33.0> Application cowlib started on node rabbit@33a3495f2088 2018-08-24 06:36:40.786 [info] <0.33.0> Application asn1 started on node rabbit@33a3495f2088 2018-08-24 06:36:40.786 [info] <0.33.0> Application public_key started on node rabbit@33a3495f2088 2018-08-24 06:36:40.886 [info] <0.33.0> Application ssl started on node rabbit@33a3495f2088 2018-08-24 06:36:40.902 [info] <0.33.0> Application ranch started on node rabbit@33a3495f2088 2018-08-24 06:36:40.905 [info] <0.33.0> Application cowboy started on node rabbit@33a3495f2088 2018-08-24 06:36:40.906 [info] <0.33.0> Application ranch_proxy_protocol started on node rabbit@33a3495f2088 2018-08-24 06:36:40.906 [info] <0.33.0> Application recon started on node rabbit@33a3495f2088 2018-08-24 06:36:40.907 [info] <0.33.0> Application rabbit_common started on node rabbit@33a3495f2088 2018-08-24 06:36:40.917 [info] <0.33.0> Application amqp_client started on node rabbit@33a3495f2088 2018-08-24 06:36:40.933 [info] <0.201.0> Starting RabbitMQ 3.7.6 on Erlang 20.3.8 Copyright (C) 2007-2018 Pivotal Software, Inc. Licensed under the MPL. See http://www.rabbitmq.com/ ## ## ## ## RabbitMQ 3.7.6. Copyright (C) 2007-2018 Pivotal Software, Inc. ########## Licensed under the MPL. See http://www.rabbitmq.com/ ###### ## ########## Logs: <stdout> Starting broker... 2018-08-24 06:36:40.974 [info] <0.201.0> node : rabbit@33a3495f2088 home dir : /var/lib/rabbitmq config file(s) : /etc/rabbitmq/rabbitmq.conf cookie hash : aX0OZ0MF2y/NcWowMMd9hw== log(s) : <stdout> database dir : /var/lib/rabbitmq/mnesia/rabbit@33a3495f2088 2018-08-24 06:36:44.801 [info] <0.209.0> Memory high watermark set to 1512 MiB (1585594368 bytes) of 3780 MiB (3963985920 bytes) total 2018-08-24 06:36:44.805 [info] <0.211.0> Enabling free disk space monitoring 2018-08-24 06:36:44.806 [info] <0.211.0> Disk free limit set to 50MB 2018-08-24 06:36:44.809 [info] <0.213.0> Limiting to approx 1048476 file handles (943626 sockets) 2018-08-24 06:36:44.809 [info] <0.214.0> FHC read buffering: OFF 2018-08-24 06:36:44.809 [info] <0.214.0> FHC write buffering: ON 2018-08-24 06:36:44.811 [info] <0.201.0> Node database directory at /var/lib/rabbitmq/mnesia/rabbit@33a3495f2088 is empty. Assuming we need to join an existing cluster or initialise from scratch... 2018-08-24 06:36:44.811 [info] <0.201.0> Configured peer discovery backend: rabbit_peer_discovery_classic_config 2018-08-24 06:36:44.811 [info] <0.201.0> Will try to lock with peer discovery backend rabbit_peer_discovery_classic_config 2018-08-24 06:36:44.811 [info] <0.201.0> Peer discovery backend does not support locking, falling back to randomized delay 2018-08-24 06:36:44.811 [info] <0.201.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping randomized startup delay. 2018-08-24 06:36:44.811 [info] <0.201.0> All discovered existing cluster peers: 2018-08-24 06:36:44.811 [info] <0.201.0> Discovered no peer nodes to cluster with 2018-08-24 06:36:44.820 [info] <0.33.0> Application mnesia exited with reason: stopped 2018-08-24 06:36:44.919 [info] <0.33.0> Application mnesia started on node rabbit@33a3495f2088 2018-08-24 06:36:45.711 [info] <0.201.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2018-08-24 06:36:45.786 [info] <0.201.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2018-08-24 06:36:45.904 [info] <0.201.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2018-08-24 06:36:45.904 [info] <0.201.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration. 2018-08-24 06:36:45.905 [info] <0.201.0> Priority queues enabled, real BQ is rabbit_variable_queue 2018-08-24 06:36:45.946 [info] <0.380.0> Starting rabbit_node_monitor 2018-08-24 06:36:45.983 [info] <0.201.0> message_store upgrades: 1 to apply 2018-08-24 06:36:45.984 [info] <0.201.0> message_store upgrades: Applying rabbit_variable_queue:move_messages_to_vhost_store 2018-08-24 06:36:45.984 [info] <0.201.0> message_store upgrades: No durable queues found. Skipping message store migration 2018-08-24 06:36:45.984 [info] <0.201.0> message_store upgrades: Removing the old message store data 2018-08-24 06:36:45.985 [info] <0.201.0> message_store upgrades: All upgrades applied successfully 2018-08-24 06:36:46.048 [info] <0.201.0> Management plugin: using rates mode 'basic' 2018-08-24 06:36:46.049 [info] <0.201.0> Adding vhost '/' 2018-08-24 06:36:46.340 [info] <0.420.0> Making sure data directory '/var/lib/rabbitmq/mnesia/rabbit@33a3495f2088/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists 2018-08-24 06:36:46.374 [info] <0.420.0> Starting message stores for vhost '/' 2018-08-24 06:36:46.374 [info] <0.424.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index 2018-08-24 06:36:46.376 [info] <0.420.0> Started message store of type transient for vhost '/' 2018-08-24 06:36:46.376 [info] <0.427.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index 2018-08-24 06:36:46.376 [warning] <0.427.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch 2018-08-24 06:36:46.377 [info] <0.420.0> Started message store of type persistent for vhost '/' 2018-08-24 06:36:46.379 [info] <0.201.0> Creating user 'admin' 2018-08-24 06:36:46.416 [info] <0.201.0> Setting user tags for user 'admin' to [management,administrator] 2018-08-24 06:36:46.459 [info] <0.201.0> Setting permissions for 'admin' in '/' to '.*', '.*', '.*' 2018-08-24 06:36:46.503 [info] <0.465.0> started TCP Listener on [::]:5672 2018-08-24 06:36:46.543 [info] <0.201.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit@33a3495f2088 2018-08-24 06:36:46.585 [info] <0.201.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit@33a3495f2088 2018-08-24 06:36:46.586 [info] <0.33.0> Application rabbit started on node rabbit@33a3495f2088 2018-08-24 06:36:46.586 [info] <0.33.0> Application rabbitmq_auth_backend_http started on node rabbit@33a3495f2088 2018-08-24 06:36:46.589 [info] <0.33.0> Application rabbitmq_auth_backend_cache started on node rabbit@33a3495f2088 2018-08-24 06:36:46.596 [info] <0.33.0> Application rabbitmq_management_agent started on node rabbit@33a3495f2088 2018-08-24 06:36:46.596 [info] <0.528.0> MQTT retained message store: rabbit_mqtt_retained_msg_store_dets 2018-08-24 06:36:46.597 [info] <0.546.0> started MQTT TCP Listener on [::]:1883 2018-08-24 06:36:46.597 [info] <0.33.0> Application rabbitmq_mqtt started on node rabbit@33a3495f2088 2018-08-24 06:36:46.598 [info] <0.549.0> rabbit_web_mqtt: listening for HTTP connections on undefined:15675 2018-08-24 06:36:46.599 [info] <0.33.0> Application rabbitmq_web_mqtt started on node rabbit@33a3495f2088 2018-08-24 06:36:46.599 [info] <0.33.0> Application rabbitmq_web_dispatch started on node rabbit@33a3495f2088 2018-08-24 06:36:46.631 [info] <0.572.0> Management plugin started. Port: 15672 2018-08-24 06:36:46.631 [info] <0.678.0> Statistics database started. 2018-08-24 06:36:46.632 [info] <0.33.0> Application rabbitmq_management started on node rabbit@33a3495f2088 completed with 7 plugins. 2018-08-24 06:36:47.039 [info] <0.5.0> Server startup complete; 7 plugins started. * rabbitmq_management * rabbitmq_web_dispatch * rabbitmq_web_mqtt * rabbitmq_mqtt * rabbitmq_management_agent * rabbitmq_auth_backend_cache * rabbitmq_auth_backend_http 2018-08-24 06:36:47.403 [info] <0.687.0> accepting AMQP connection <0.687.0> (10.154.242.247:57488 -> 172.17.0.2:5672) 2018-08-24 06:36:47.944 [info] <0.687.0> connection <0.687.0> (10.154.242.247:57488 -> 172.17.0.2:5672): user 'admin' authenticated and granted access to vhost '/' 2018-08-24 06:36:48.902 [info] <0.713.0> accepting AMQP connection <0.713.0> (10.154.242.247:57490 -> 172.17.0.2:5672) 2018-08-24 06:36:48.914 [info] <0.713.0> connection <0.713.0> (10.154.242.247:57490 -> 172.17.0.2:5672): user 'admin' authenticated and granted access to vhost '/' 2018-08-24 06:38:57.264 [info] <0.736.0> accepting AMQP connection <0.736.0> (141.40.204.6:33871 -> 172.17.0.2:5672) 2018-08-24 06:38:57.746 [info] <0.736.0> connection <0.736.0> (141.40.204.6:33871 -> 172.17.0.2:5672): user 'device_11' authenticated and granted access to vhost '/' 2018-08-24 06:39:10.314 [info] <0.772.0> accepting AMQP connection <0.772.0> (10.154.242.247:57494 -> 172.17.0.2:5672) 2018-08-24 06:39:10.346 [info] <0.772.0> connection <0.772.0> (10.154.242.247:57494 -> 172.17.0.2:5672): user 'admin' authenticated and granted access to vhost '/'
and the connectivity panel shows that everything is fine