YANO's digital garage

Copyright ©YANO All rights reserved. https://www.bravotouring.com/~yano/

Last-modified: 2024-03-09 (土)


[一語一絵/IT系]

IRKit独立 / 2022-06-11 (土)

2014年1月から12800台が生産され、2017年11月25日に完売した[External]IRKitだが、なんと4月に[External]サービス終了の案内が出ていた事に気づいた。

IRKit
2016年に購入したIRKit

2016年に調達した手元のIRKit3月に復活したばかりだが、最初にサーバに接続してからでないと"Device HTTP API"すら使えなくなるという事で、打つ手なし。

と思いきや、

幸いにもIRKitのファームウェアはオープンソースであり、この問題を解決してくれた方がいらっしゃいます。 こちらのpull request https://github.com/irkit/device/pull/6 を書き込むと useCloudControl という設定をfalseにしてビルドすることで、サーバに接続する機能を停止します。この時ローカルネットワークは使えます。
という救済策が案内されていたので、早速 [External]GitHub - acourreges/device からファームウェアを入手してファームアップにトライ。

出荷時に設定されるWi-Fiアクセスポイントのパスワードとバージョン情報を適当に設定して、arduino-1.8.10でアップロード。

しかし、IRKitは再起動しても一向にLEDが赤明滅にならず。青点灯して消灯となってしまったのでRebootを繰り返しているものと思っていたのだが、アクセスポイントの接続状態をチェックしたところ以前の設定通り自宅のWiFiに繋がっていることが判明。pingでも応答があるし、curlにも従前通り反応。レスポンスヘッダのServer行で出力されるバージョンでもファームアップできていることが確認できた。

というわけで、自宅のWiFi接続情報が消えてなかったので、ファームアップしてもファクトリーリセットではないという事らしい。

ただavahi-browseに反応しなくなっていたので、setupMDNSだけはuseCloudControlの設定に依らず効くように変更し、最終的に変更点は以下の通り。

yano@GT110b:~/IRKit$ git clone https://github.com/acourreges/device.git
yano@GT110b:~/IRKit$ cd ~/IRKit/device
yano@GT110b:~/IRKit/device$ vi firmware/src/IRKit/GSwifi.cpp firmware/src/IRKit/IRKit.ino firmware/src/IRKit/cert.h
yano@GT110b:~/IRKit/device$ git diff -b
diff --git a/firmware/src/IRKit/GSwifi.cpp b/firmware/src/IRKit/GSwifi.cpp
index b6ed100..97713bf 100644
--- a/firmware/src/IRKit/GSwifi.cpp
+++ b/firmware/src/IRKit/GSwifi.cpp
@@ -1093,7 +1093,7 @@ int8_t GSwifi::startLimitedAP () {
     command(PB("AT+NSET=192.168.1.1,255.255.255.0,192.168.1.1",1), GSCOMMANDMODE_NORMAL);

     // password area overwritten in factory
-    cmd = PB("AT+WPAPSK=IRKitXXXX,XXXXXXXXXX",1);
+    cmd = PB("AT+WPAPSK=IRKit41D9,2041357304",1);
     strcpy( cmd+10, hostname() );
     cmd[19] = ',';
     command(cmd, GSCOMMANDMODE_NORMAL, GS_TIMEOUT_LONG);
diff --git a/firmware/src/IRKit/IRKit.ino b/firmware/src/IRKit/IRKit.ino
index 2351b59..1342f0a 100644
--- a/firmware/src/IRKit/IRKit.ino
+++ b/firmware/src/IRKit/IRKit.ino
@@ -315,14 +315,14 @@ void connect() {

     if (gs.isListening()) {

+        // start mDNS
+        gs.setupMDNS();
+
         if (!config::useCloudControl) {
             // No WAN access, we don't need to validate key, we're ready.
             IR_state( IR_IDLE );
             on_irkit_ready();
         } else {
-            // start mDNS
-            gs.setupMDNS();
-
             if (keys.isAPIKeySet() && ! keys.isValid()) {
                 irkit_httpclient_post_door();
             }
diff --git a/firmware/src/IRKit/cert.h b/firmware/src/IRKit/cert.h
index cf6dcb3..01fc839 100644
--- a/firmware/src/IRKit/cert.h
+++ b/firmware/src/IRKit/cert.h
@@ -20,7 +20,7 @@
#include "GSwifi_const.h"

// deviceapi.getirkit.com
-prog_uchar der[] PROGMEM = {
+const char der[] PROGMEM = {
     ESCAPE, 'W',
     0x30, 0x82, 0x2, 0xed, 0x30, 0x82, 0x2, 0x56,
     0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x9, 0x0,
diff --git a/firmware/src/IRKit/config.h b/firmware/src/IRKit/config.h
index 2888117..89fa3f6 100644
--- a/firmware/src/IRKit/config.h
+++ b/firmware/src/IRKit/config.h
@@ -31,13 +31,13 @@ namespace config {
     } LedFeedbackProfile;

     // Defines what kind of LED profile you want.
-    const LedFeedbackProfile ledFeedback = LED_QUIET;
+    const LedFeedbackProfile ledFeedback = LED_VERBOSE;

     // Enables/disables cloud-control through the "deviceapi.getirkit.com" server.
     // If you use your IRKit device exclusively over your LAN, you can disable
     // this option: the device won't send regular polling requests to the cloud server.
     // This also lets you setup your device without internet access (no need for a valid device key).
-    const bool useCloudControl = true;
+    const bool useCloudControl = false;

}

yano@GT110b:~/IRKit/device$

サーバに接続しなくなるとiOSやAndroidのアプリも使えなくなるかと思いきや、同一LAN配下であればそのまま使えるようだ。

【参照】
●IRKit http://getirkit.com/
Device HTTP API
Internet HTTP API
●maaash.jp https://maaash.jp/
IRKit Internet HTTP APIと販売開始に向けて 2014年1月
IRKitリリース!そして再入荷予定について 2014年1月
IRKitの脆弱性とファームウェアアップデートのお願い 2015年9月
Nature RemoのKickstarterを開始しました 2016年5月
IRKitサービス終了(そろそろ) 2022年4月23日
●ICT備忘録 http://category7.blog.fc2.com/
IRKit の LEDの光 と Cloud Serverへのアクセス をオフにしてみた。 2015年8月15日
●GitHub https://github.com/
IRKit
irkit/device: Infrared-WiFi-HTTP bidirectional proxy device
acourreges/device: Infrared-WiFi-HTTP bidirectional proxy device
●Wikipedia https://ja.wikipedia.org/wiki/
Arduino
マルチキャストDNS
Bonjour