Created
September 18, 2017 09:10
-
-
Save GOROman/bd2af0f08f76aa5ae5de38d022e23769 to your computer and use it in GitHub Desktop.
Ruby で THETA Vを制御したいのだけどコケるので死にたい
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#RICOH THETA V を制御したいけどコケる | |
require 'net/http' | |
require 'json' | |
require 'pp' | |
HOST = '192.168.1.1' # THETA VのWIFI接続時のアドレス | |
PORT = 80 # THETA Vの制御ポート | |
http = Net::HTTP.new(HOST, PORT) | |
info = JSON.parse(http.get("/osc/info").body) | |
pp info | |
state = JSON.parse(http.post("/osc/state","").body) | |
pp state | |
json = { | |
name: "camera.startSession", | |
parameters: {} | |
} | |
r = http.post('/osc/commands/execute', json.to_json) # <============== これがコケる | |
pp r | |
pp r.body | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
誰か氏~