W&T's diary

W&T Thermal Cam に関連する情報

ESP8266を使う場合のインストール方法 Installation method when using ESP8266

アプリ実行前に...。 Before running the application ....

 

このアプリは以下の別部品およびソースのインストールが必要です。順番に沿って部品の調達およびソフトのインストールを行ってください。WROOM02のソースコンパイル時はモリーとCPUスピード設定をそれぞれ80MHz,160MHzに設定が必要です。(Thermal Cam (for LEPTON1)は以前周波数を下げていましたが、V2.0では周波数を上げてコンパイルします)※「5.ボード設定は以下の通りとしてください」参照

まずESP8266開発ボード、LEPTON3、LEPTONブレイクアウトボードを手に入れてください。 以下必要部品の入手先とLEPTON画像再現までの手順です。

This application requires installation of the following separate parts and source. Please procure parts and install software according to the order. When source compiling WROOM 02, it is necessary to set memory and CPU speed setting to 80 MHz and 160 MHz respectively. 

 First, get the ESP 8266 development board,  LEPTON 3, LEPTON breakout board.Below is the procedure from where to obtain the required parts to LEPTON image reproduction.

 1.ESP8266開発ボードを用意してください。Prepare the ESP8266 development board.

f:id:TAKEsan:20191118111932p:plain 

LEPTON3はSPIとi2C及び3.3V出力端子が必要です。これらの端子が使用できないボードもありますので、購入時は注意してください。

LEPTON 3 requires SPI and i2C and 3.3 V output terminals. Some boards can not use these terminals, so be careful when purchasing.

専用のボードを販売しています。(W&T Thermal Cam PCB)

         W&T Thermal Cam PCB - スイッチサイエンス

         W&T Thermal Cam PCB用パーツセット - スイッチサイエンス

SPIの信号が安定するばかりでなく、WiFiの飛距離が技適範囲内で大きく伸びます。

 We decided to sell the board we made. In addition to stabilizing the signal of SPI, the distance of WiFi will dramatically increase within the technical range! ! .

2. LEPTON3又は3.5を用意してください。Please prepare LEPTON3 or 3.5

f:id:TAKEsan:20191118113207p:plain

 LEPTONセンサー自体は完全防水で、衝撃にもかなり強いため悪条件にびくともしませんが、取り外し可能なシャッター部品は壊れやすい欠点があります。取り扱いには十分に注意してください。LEPTONは定期的にシャッターを閉じて画像のキャリブレーションを行っていますが、シャッターが壊れると残像が残るなど、画像に障害が出て来ます。今の所シャッターの交換部品は販売していない様なので、取り扱いには十分注意が必要です。

The LEPTON sensor itself is completely waterproof, and it is quite strong for impact, so it does not bother with adverse conditions, but detachable shutter parts have a breakable disadvantage. Please handle with care. LEPTON regularly closes the shutter and calibrates the image, but if the shutter breaks, afterimages will remain, such as image failure will come out. Currently it seems that we do not sell replacement parts for the shutter, so careful handling is necessary.

3. BREAKOUT BOARDが必要です。 BREAKOUT BOARD is required.   

f:id:TAKEsan:20191118113845p:plain

Ver1.0 は製造中止ですが ver2.0 はFLIR Lepton Breakout Board v2.0 | FLIR Systemsで手に入ります

In Japan, you can get it with Cornes Technology or Digi - Key.                              

 4. Arduino IDEをインストールします(Macの場合) Install Arduino IDE (Mac)

Arduino IDE https://www.arduino.cc/en/main/software  をインストール

IDEを起動させたら、

Arduino-->Preferences 

出てきた環境設定ダイアログの下の方「追加ボードマネージャーのURL:」の中に

http://arduino.esp8266.com/stable/package_esp8266com_index.json

を書き込む。

Install Arduino IDE https://www.arduino.cc/en/main/software   After starting the IDE,

Arduino-->Preferences

In the lower part of the setting dialog that came out "in the URL of additional board manager:"

http://arduino.esp8266.com/stable/package_esp8266com_index.json

 f:id:TAKEsan:20171008224533p:plain

ツール-->開発ボード-->ボードマネージャー を選択

最後の方にesp8266 by esp8266 Community という項目があります。 f:id:TAKEsan:20170920210049p:plain

バージョンは必ず2.2.0 を選択してください。(上図はすでに2.2.0を選択してるので選択画面には出て来ていない)すでに 2.3.0を選択している方は 2.2.0にバージョンを落としてください。2.3.0で今回のソースをインストールするとうまく動作しません。 

Be sure to select 2.2.0 for the version. (Since the above figure has already selected 2.2.0, it has not appeared on the selection screen.) If you have already selected 2.3.0 please drop the version to 2.2.0. Installing this source in 2.3.0 does not work well.

 5. ボード設定は以下の通りです。 The board settings should be as follows.

シリアルポートはESP8266を接続すれば表示されますが、Bluetoothでない方を選択します。注意点は、Macの場合ESP8266を何回も抜き差しすると、USBを認識しなくなることです。認識しない場合はMac側のUSBコネクタを変更すると、認識するようになります。MacBookのようにUSBコネクタが2つしかなくて両方認識しなくなったら、再起動……。です。       Flash Frequency=80MHz、CPU Frequency=160MHzであることに注意してください。    

The serial port will be displayed if you connect the ESP 8266, but choose the one that is not Bluetooth. The caveat is that if you plug or unplug ESP 8266 multiple times on a Mac, it will not recognize USB. If you do not recognize it, you will recognize it when you change the USB connector on the Mac side. If there are only two USB connectors like a MacBook and both do not recognize, restart ....... is. Please note that Flash Frequency = 80 MHz, CPU Frequency = 160 MHz.                 

f:id:TAKEsan:20170924110748p:plain

f:id:TAKEsan:20170920210155p:plain   

 6. OSCライブラリをインストールします。 Install the OSC library.

Arduino IDEの Arduino—>Preferences..  を選択して一番上の スケッチブックの保存場所を確認します。

Select Arduino-> Preferences .. in the Arduino IDE and check the storage location of the top sketchbook.

 f:id:TAKEsan:20170920210844p:plain

この中にlibraries フォルダがあるかどうか確認します

Make sure there is a libraries folder in this.

無かったらlibrariesフォルダを作成します。以下のURLを開いて

https://github.com/sandeepmistry/esp8266-OSC

ESP8266のOSCライブラリをダウンロード解凍してlibrariesフォルダに移動させます。

一度Arduino IDEを終了させ、再起動後 スケッチ-->ライブラリをインクルードを選択して 「OSC 」が入っているかどうか確認。

If you do not have it, create a libraries folder. Open the following URL

    https://github.com/sandeepmistry/esp8266-OSC 

Unzip the OSC library of ESP 8266 and move it to the libraries folder.

Exit the Arduino IDE once, after restarting, select Sketch -> Include Library to check if "OSC" is included.

 7. iPhoneを設定します。 Configure iPhone.

iPhone を普通に初期設定するとssidは日本語になります。エラーが起きる可能性がありますので半角英字に修正してください。

 設定-->一般-->情報-->名前-->現在のiPhone名称>を選択 で名称を変更します。名称を変更してもiPhone自体の挙動に影響はありません。 

When initializing iPhone as usual, ssid becomes Japanese. Please correct it to half-width alphabetical as it may cause an error.

Choose Settings -> General -> Information -> Name -> Current iPhone Name> to change the name. Changing the name does not affect the behavior of the iPhone itself.

 8. ESP8266Arduino ソースをダウンロードします。Download the ESP 8266 Arduino source.

LEPTON3.5の場合(for LEPTON3.5 )

Thermal_Cam3X_ESP_20220510.ino - Google ドライブ

上記URLからダウンロードしてください。Arduino IDEを開いて、ダウンロードしたファイルをダブルクリック。フォルダの中に入れますか?と聞かれるので、YESを選択。OSCやSPIの安定化、UDPパケット紛失問題の解消、ESP特有のWDTリセットの解決方法をコメントしておきました。ボードを選べば100m以上離れた場所でLEPTONの画像が再現できます。 

Please download from the above URL.Open Arduino IDE and double click on the file you downloaded now. Can you put it in the folder? As you are asked, choose YES. We commented on the stabilization of OSC and SPI, the elimination of UDP packet loss problem, and the solution method of WSP reset specific to ESP. If you choose a board, LEPTON images can be reproduced in places more than 100 m away.

 9. 今回のiPhoneアプリをダウンロードします。Download this iPhone application.                

f:id:TAKEsan:20191114144756p:plain

W&T又はkansaidenkiで検索。Themal Cam3Xを探します。申し訳有りませんが有料アプリです。

Search by W&T or kansai. Look for  Themal Cam 3X according. Sorry, this is a paid app.

 10. 今回のソースを開いて一部を修正します。Open this source and fix some.

修正が必要な部分は、以下の3箇所です。 

         40,41行目付近   

          #define SSID_X    “ABiPhone”   //iPhone 

          #define PASS_X    "11111111"   //iPhone 

 ABiPhoneにiPhoneの名称、11111111 に 設定-->モバイルデータ通信-->Wi-Fiのパスワード を調べて パスワードを入力します。

          51行目付近

          #define LEDpin 16 

に自分のボードに合ったLEDのピン番号を入力してください。LEDは特に必要ありませんが、ESP8266の状態がわかるので、点灯すると便利です。サインは以下の通りです。

  • LED 長点滅 初期のWiFi接続中の場合点滅。
  • LED 短点滅 iPhone側のアプリが中断した場合点滅。
  • 無点滅   正常にデータを送っている場合。
  • 無点滅中一瞬LEDが光る場合 パケットが紛失して、再度同じパケットを送っている時。ピカッピカッが多いときは、周囲の電波状態が悪く連続してパケット修正をしている状態なので、画像のフレームレートが下がります。

 GPSをONにすると、周期的に一瞬ピカッと光ります。確実にパケットを紛失してるのですが画像にはさほど影響がないことがわかると思います。BlueToothをONにするとさすがにたくさん点滅してフレームレートが多少落ちます。

The parts that need to be modified are the following three places. 

Near lines 34 and 35 

          #define SSID_X    “ABiPhone”   //iPhone

          #define PASS_X    "11111111"   //iPhone

Set the name of iPhone to ABiPhone, set to 11111111 -> Mobile data communication -> Enter the password by checking the Wi - Fi password.

          Line 47 (for LEPTON 1) Near line 53 (for LEPTON 3)

           #define LEDpin 16

Please enter the pin number of LED matching your board. Although LED is not particularly necessary, it is convenient to light up as you can understand the state of ESP 8266. The signature is as follows.

  • LED blinking - when initial WiFi connection is in progress. 
  • LED Flash short blink Blinks - when iPhone side application is interrupted.
  • No flashing - When sending data normally.
  • When the LED glows instantaneously during blinking - When the packet is lost and is sending the same packet again. When there are a lot of shocks, the frame rate of the image decreases because the ambient radio condition is bad and the packet is being corrected continuously.

When GPS is turned on, it glows shimmerly periodically. I think that you can see that there is not much effect on the picture although it surely loses the packet. When BlueTooth is turned on, it glows a lot and the frame rate drops.

11. ESP8266とLEPTON BREAKOUT BOARD を接続します。Connect ESP 8266 and LEPTON BREAKOUT BOARD.

スイッチサイエンスESPrの場合、LEPTONブレイクアウトボードとESP8266の結線は以下の通りです

For switch science ESPr, the connection between LEPTON breakout board and ESP 8266 is as follows 

       f:id:TAKEsan:20191118122016p:plain                       

 12. WROOM02(ESP8266)ボードにプログラムを転送します。Transfer the program to WROOM02 (ESP8266) board.

以上設定が終わったらコンパイル、転送します。たまにエラーが出る場合がありますが、その場合は再度転送してください。(USBを認識していない場合が多い)

When compilation and transfer are done, it completes. Although occasionally an error may appear, please transfer again in that case. (USB is not recognized in many cases) 

13. いよいよサーモグラフィー開始 The thermography finally starts !!

iPhoneX、11Proでの動作確認をしています。iPadでも動くと思いますが、両者ともCPUはA9以上が必要です。iPhone 11 Pro MAX、Xs、Xs Pro、XR、8、8Plus、他のiPadに関してはシュミレーターで動作を確認・調整しています。

インストール作業から1回目の動作確認までは、簡単とは言えませんが、Arduinoに慣れている皆さんにとっては全く問題のない過程です。セキュリティーを保ったまま、2回目以降は3ステップ(LEPTON側スイッチオン-->インターネット共有-->iPhoneアプリ起動)で動いてしまいます。煩わしいWiFi選択やIP、パスワード入力などは全く必要ありません。また、テザリングを使っていても外部とは通信しないので、Thermal Cam3動作に関する通信料金は発生しません。

*iPhoneの機種や周囲の環境によりテザリングがつながりにくい場合があります。その場合には

  • ESP8266の電源を入れ直す
  • 機内モードON->OFF を実行してからインターネット共有をONにする。
  • iPhoneの電源を入れ直す
  • 時間や場所を変えて再接続を行う

I am checking the operation with X,11Pro. I think that it will work on general iPad, but both require A9 or more CPU. For iPhone Xs,Xs Pro,XR,8, 8 Plus, and other iPads, the operation is checked and adjusted with a simulator.

It is not easy from installation to first confirmation of operation, but for everyone who is accustomed to Arduino it is a completely problem free process. While keeping security, it moves with 3 steps (LEPTON side switch ON -> Internet share -> iPhone application launch) after the second time. No troublesome WiFi selection, IP, password entry etc are required at all. Also, even if you use tethering, you will not communicate with the outside, so there will be no communication fee for Thermal Cam 3 operation.

*Tethering may be difficult to connect depending on the iPhone model and surrounding environment. In that case.

  • Power cycle ESP8266.
  • Execute Airplane mode ON-> OFF and then turn on Internet sharing.
  • Power cycle your iPhone.
  • Reconnect at a different time or location.

Goto Home