IRKit service has been terminated.
Please check https://maaash.jp/2022/04/deprecating-irkit/ in Japanese or in English
What's IRKit
IRKit is a Wi-Fi enabled Open Source Infrared Remote Controller device.
Home electronics with an infrared remote, like air conditioners, TVs, lights can be controlled using iPhone, iPad, Android phones via IRKit.
When you want to take a photo, chat with someone, you choose an app from AppStore. A simple focused app, a beautifully designed app, a full featured app, there're plenty of apps for you. But there were not much options when you want to control your home electronics.
You know you'll use a smartphone app to control your home electronics. IRKit is a device that helps to bring that future.
Buy IRKit on Amazon.co.jp (ships inside Japan) or SWITCHSCIENCE (Worldwide shipping) .
IRKit works with IRKit's official iOS app, IRKit's official Android app and you can easily create iOS apps to send IR signals to control home electronics using IRKit iOS-SDK .
You can create apps for example that does:
- Use location, turns on air conditioner when you arrive near your home.
- Press one button to turn off all your home electronics when you leave home.
- Connect with Facebook, and automatically change your TV's channel to which your friend is watching.
You can also use JavaScript to send IR signals,
or use curl on Terminal to send IR signals
IRKit itself runs a HTTP server.
You can POST JSON formatted IR signal to it to send IR signals.
When you're not in the same Wi-Fi network, you can POST to our server on internet to send IR signals also.
IRKit is a Arduino derivative Open Source hardware.
Open pins are pulled out, so you can add some components like temperature sensor or brightness sensor and modify IRKit's firmware, write it into IRKit using Arduino IDE to make it more smart.
So, what did you hate about your remote controller?
How would you like to control it?
IRKit iOS SDK
It's as simple as:
See more on irkit/ios-sdk
IRKit Device Hardware
See more on irkit/device/hardware
IRKit Device Firmware
IRKit Device Case
See more on irkit/device/case
IRKit Device HTTP API
IRKit device uses Bonjour to be discovered.
After you get IRKit's IP address, access it's HTTP API.
* If you use a HTTP client that uses Bonjour to resolve .local hostnames, you don't need above step.
GET /messages
Get latest receive IR signal.
IRKit clear's it's IR signal memory after responding to GET /messages
request.
So you won't GET the same IR signal twice.
POST /messages
Send IR signal.
- When using curl.exe in Windows, don't forget to escape double quotes. Use following escaping:
-d "{\"format\":\"raw\",\"freq\":38,\"data\":[...]}"
POST /keys
Get a clienttoken
Pass clienttoken
over to next request: POST /1/keys to get clientkey
and deviceid
.
See IRKit Internet HTTP API for details.
POST /wifi
IRKit connects to your home Wi-Fi accesspoint.
To connect, you have to pass your home Wi-Fi accesspoint's security settings (WPA2/WEP/NONE), SSID and password to IRKit.
To pass those Wi-Fi information to IRKit, you first connect to IRKit's own Wi-Fi accesspoint.
Serialize Wi-Fi information along with the devicekey
, and put the serialized string in the request body to POST /wifi
.
Serializer is implemented in JavaScript: keyserializer test and Objective-C: - (NSString *)morseStringRepresentation.
After POST /wifi
responds with HTTP status code 200, request against POST /1/door to check if IRKit successfully connected to Internet.
IR signal JSON represntation
IR signal JSON representation looks like above.
JSON object has following keys.
Key | Description |
---|---|
format | "raw" only |
freq | IR sub-carrier frequency. 38 or 40 only. [kHz] |
data | IR signal consists of ON/OFF of sub carrier frequency. IRKit measures On to Off, Off to On interval using a 2MHz counter. data value is an array of those intervals |
IRKit Internet HTTP API
IRKit Device HTTP API can be accessed when HTTP client is in the same Wi-Fi network.
If the HTTP client is not in the same Wi-Fi network, you can request against our server on Internet, to send IR signals.
Overview
When using IRKit's Internet server, you'll need following 2 request parameters.
These are used to know who sent this request, and which IRKit device it's targetted to.
Name | Description |
---|---|
clientkey | key to authenticate itself |
deviceid | IRKit device identifier. |
To get clientkey
and deviceid
, the're 2 ways.
If you already have a Wi-Fi connected IRKit device,
use POST /keys against IRKit device to get a clienttoken
, and pass it to our server on Internet using POST /1/keys.
If you already have IRKit, and you want to use it more aggressively, use this course.
If you have an IRKit device not connected to Wi-Fi and not able to use our official apps (iOS/Android) or SDKs(iOS/Android),
for example if you want to create a SDK for WindowsPhone, use following course.
POST /1/clients to get a clientkey
,
and POST /1/devices to get a devicekey
, deviceid
and finally pass devicekey
along with your home Wi-Fi access point's information to IRKit, via it's own Wi-Fi access point. (See POST /wifi)
devicekey
is used by IRKit device to authenticate itself.
POST /1/keys
Get deviceid
.
If optionally provide clientkey
request parameter, provided clientkey
and deviceid
's relationship will be saved on server.
With deviceid
, you can send IR signals using POST /1/messages
and receive IR signals using GET /1/messages.
Request Parameters
Name | Required | Description |
---|---|---|
clienttoken | o | Get one from POST /keys |
clientkey | x | see Overview. If optionally provided, Internet server will remember relationship between clientkey and IRKit device. |
Response JSON keys
Name | Description |
---|---|
deviceid | see Overview |
clientkey | see Overview |
POST /1/messages
Send IR signal through IRKit device identified by deviceid
.
Request Parameters
Name | Required | Description |
---|---|---|
clientkey | o | see Overview |
deviceid | o | see Overview |
message | o | see IR signal JSON representation |
GET /1/messages
Get latest received IR signal.
This request is a long polling request.
Provide clear=1
parameter to clear IR signal receive buffer on server.
When IRKit device receives an IR signal, device sends it over to our server on Internet, and server passes it over as response.
Server will respond with an empty response after timeout.
When you want to receive an IR signal, 1st request should add clear=1
parameter, and following requests after timeout should not.
Use deviceid
and hostname
in response to distinguish which IRKit device received the IR signal in response.
Request Parameters
Name | Required | Description |
---|---|---|
clientkey | o | see Overview |
clear | x | Clear IR receive buffer on server |
Response Parameters
Name | Description |
---|---|
message | see 赤外線信号を表すJSONについて |
hostname | IRKit device hostname. Add .local suffix to request IRKit Device HTTP API if client is in the same Wi-Fi network |
deviceid | see Overview |
POST /1/clients
Get a clientkey
.
Request Parameters
Name | Required | Description |
---|---|---|
apikey | o | see POST /1/apps |
Response Parameters
Name | Description |
---|---|
clientkey | see Overview |
POST /1/devices
Get devicekey
and deviceid
.
Pass devicekey
to IRKit device using Morse code or IRKit itselves Wi-Fi access point.
Request Parameters
Name | Required | Description |
---|---|---|
clientkey | o | see Overview |
Response Parameters
Name | Description |
---|---|
devicekey | see Overview |
deviceid | see Overview |
POST /1/door
After you send your home Wi-Fi accesspoint's information along with a devicekey
to IRKit through IRKit's own accesspoint (POST /wifi), use POST /1/door
to check if IRKit had successfully connected to your home Wi-Fi accesspoint and to our server on Internet.
This request is a long polling request.
Our server on Internet will immediately respond when server confirms IRKit is connected,
otherwise you'll receive an empty response after timeout.
Request Parameters
Name | Required | Description |
---|---|---|
clientkey | o | see Overview |
deviceid | o | see Overview |
Response Parameters
Name | Description |
---|---|
hostname | Bonjour hostname (ex: #{hostname}.local ), used by HTTP clients connected to the same Wi-Fi accesspoint. |
POST /1/apps
Get apikey
.
Request Parameters
Name | Required | Description |
---|---|---|
o | Developer email address |
Response Parameters
Name | Description |
---|---|
message | - |