Skip to content

Instantly share code, notes, and snippets.

View roryaronson's full-sized avatar
🏄‍♂️

Rory Aronson roryaronson

🏄‍♂️
View GitHub Profile
@roryaronson
roryaronson / gist:dd5bced495bd6b3f4c5d
Created June 5, 2014 04:59
After starting sync.rb and then controller.rb, this is what I get, though it still seems to function. Line 11 gets repeated indefinitely
pi@farmbot ~/farmbot-raspberry-pi-controller $ ruby controller.rb
[FarmBot Controller]
starting up
connecting to hardware
starting farmbot
DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.find_or_create_by(name: 'foo') instead. (called from check_refresh at /home/pi/farmbot-raspberry-pi-controller/lib/database/dbaccess.rb:116)
checking schedule
DEPRECATION WARNING: Calling #find(:all) is deprecated. Please call #all directly instead. You have also used finder options. These are also deprecated. Please build a scope instead of using finder options. (called from get_command_to_execute at /home/pi/farmbot-raspberry-pi-controller/lib/database/dbaccess.rb:98)
DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from get_command_to_execute at /home/pi/farmbot-raspberry-
pi@farmbot ~/farmbot-raspberry-pi-controller $ ruby farmbot.rb
WARN: Unresolved specs during Gem::Specification.reset:
minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/home/pi/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /home/pi/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:152:in `rbuf_fill'
from /home/pi/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil'
from /home/pi/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:144:in `readline'
from /home/pi/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http/response.rb:39:in `read_status_line'
message {"params"=>{"x"=>1000, "y"=>100, "z"=>100, "speed"=>100}, "method"=>"single_command.MOVE RELATIVE", "devices"=>"63977486-2bde-4a96-93f7-8b578a4ed18d", "id"=>"1bff313b-a233-4f9f-9e8c-720d9a234812", "fromUuid"=>"1868b2d4-20bc-42da-aa11-b84609f78015"}
@roryaronson
roryaronson / gist:76c2af8818f66b71422a65c4442853b7
Created April 15, 2016 00:50
segmentation fault when pairing with the production web app
Want to run `ruby farmbot.rb` now?
y
Connecting...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12 0 12 0 0 29 0 --:--:-- --:--:-- --:--:-- 29
Conencting to localhost:1883
Connected!
/home/pi/.rvm/gems/ruby-2.3.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:202: [BUG] Segmentation fault at 0x000000
ruby 2.3.0p0 (2015-12-25 revision 53290) [armv7l-linux-eabihf]
{"params":{"_id":"5733a0ff1178c90008000018","name":"New Sequence","color":"pink","s│···················
teps":[{"_id":"5733ac3f1178c9000800001b","command":{"x":"1000","y":"1000"},"message│···················
_type":"move_absolute","position":0},{"message_type":"wait","command":{"value":"300│···················
0"},"position":1},{"message_type":"move_absolute","command":{"x":"0","y":"0"},"posi│···················
tion":2}],"dirty":true},"method":"exec_sequence","id":"aa594d26-496a-4084-9d13-d9a7│···················
609de135"} │···················
Executed move_absolute after 0.19270800000000002 ms │···················
Executed wait after 3000.196247 ms │···················
Executed move_absolute after 0.317603 ms │···················
RPI MSG: G0 X1000 Y1000 Z0 │····
roryaronson@roryaronson-VirtualBox:~/farmbot-web-frontend$ npm install
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global node-gyp@3.3.1 should be installed with -g
> node-sass@3.8.0 install /home/roryaronson/farmbot-web-frontend/node_modules/node-sass
> node scripts/install.js
---
defaults:
secrets_file: secrets.txt
mqtt_port: 1883
serial_ports: &1
- "/dev/ttyUSB0"
- "/dev/ttyACM0"
development:
secrets_file: secrets.txt
mqtt_port: 1883
---
defaults:
secrets_file: secrets.txt
mqtt_port: 1883
serial_ports: &1
- "/dev/ttyUSB0"
- "/dev/ttyACM0"
development:
secrets_file: secrets.txt
mqtt_port: 1883
@roryaronson
roryaronson / gist:20a3a54f1980635e5fa0d4a7c5e03406
Created June 20, 2016 23:20
Staging settings.yml (after running farmbot.rb)
---
defaults:
secrets_file: secrets.txt
mqtt_port: 1883
serial_ports: &1
- "/dev/ttyUSB0"
- "/dev/ttyACM0"
development:
secrets_file: secrets.txt
mqtt_port: 1883
@roryaronson
roryaronson / gist:8c82210f108c6513bee0466a85b404ef
Created June 20, 2016 23:25
Paired with staging settings.yml (before running farmbot.rb)
---
defaults:
secrets_file: secrets.txt
mqtt_port: 1883
serial_ports: &1
- "/dev/ttyUSB0"
- "/dev/ttyACM0"
development:
secrets_file: secrets.txt
mqtt_port: 1883