1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sony Spresense LTE拡張ボードとSORACOM IoT SIM(plan01s – Low Data Volume)で通信テスト

Last updated at Posted at 2020-12-27

Sony Spresenseでセンサーから取得したデータをクラウドにアップする前に
サンプルスケッチで LTEデータ通信 のテストを行いました。

SIMカードは IoT SIM (plan-D) を使用しました。
Arduino IDE を 開いて ボードを Sony Spresense に設定します。
次に スケッチ例 で LteWebClient を選択します。

27行目からの APN data の設定を SORACOM IoT SIM に合わせて以下のように変更します。

// APN data
# define LTE_APN       "soracom.io"      // replace your APN
# define LTE_USER_NAME "sora"     // replace with your username
# define LTE_PASSWORD  "sora" // replace with your password

ここの設定が違っているとシリアルモニタに以下のようにエラー表示されます。

12:56:25.078 -> Starting web client.
12:56:30.867 -> ERROR: Invalid APN name.
12:56:30.867 -> An error occurred, shutdown and try again.

正しく設定されていればシリアルモニタに以下の表示がされて通信が出来ているのを確認出来ます。

通信ログ

12:21:53.876 -> Starting web client.
12:22:19.345 -> attach succeeded.
12:22:19.933 -> connected
12:22:20.865 -> HTTP/1.1 200 OK
12:22:20.865 -> Server: nginx/1.4.2
12:22:20.865 -> Date: Sun, 27 Dec 2020 03:22:21 GMT
12:22:20.865 -> Content-Type: text/plain
12:22:20.865 -> Content-Length: 2263
12:22:20.865 -> Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT
12:22:20.865 -> Connection: close
12:22:20.865 -> Vary: Accept-Encoding
12:22:20.865 -> ETag: "524c23c7-8d7"
12:22:20.865 -> Accept-Ranges: bytes
12:22:20.865 -> 
12:22:20.865 -> 
12:22:20.865 ->            `:;;;,`                      .:;;:.           
12:22:20.865 ->         .;;;;;;;;;;;`                :;;;;;;;;;;:     TM 
12:22:20.899 ->       `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;      
12:22:20.899 ->      :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;     
12:22:20.899 ->     ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;    
12:22:20.899 ->    ;;;;;;;;:`   `;;;;;;;;;     ,;;;;;;;;.`   .;;;;;;;;   
12:22:20.899 ->   .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;  
12:22:20.899 ->   ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;. 
12:22:20.934 ->  ,;;;;;               ;;;;;;.;;;;;;`              ;;;;;; 
12:22:20.934 ->  ;;;;;.                ;;;;;;;;;;;`      ```       ;;;;;`
12:22:20.934 ->  ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;
12:22:20.934 -> `;;;;:                  `;;;;;;;;        ;;;        ;;;;;
12:22:20.934 -> ,;;;;`    `,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;
12:22:20.934 -> :;;;;`    .;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;;
12:22:20.934 -> :;;;;`    .;;;;;;;;      `;;;;;;      :;;;;;;;;     ;;;;;
12:22:20.967 -> .;;;;.                   ;;;;;;;.        ;;;        ;;;;;
12:22:20.967 ->  ;;;;;                  ;;;;;;;;;        ;;;        ;;;;;
12:22:20.967 ->  ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;,
12:22:20.967 ->  ;;;;;;               `;;;;;;;;;;;;                ;;;;; 
12:22:20.967 ->  `;;;;;,             .;;;;;; ;;;;;;;              ;;;;;; 
12:22:20.967 ->   ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;  
12:22:21.001 ->    ;;;;;;;`       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:  
12:22:21.001 ->     ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;   
12:22:21.001 ->     `;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;    
12:22:21.001 ->       ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:     
12:22:21.001 ->        ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;       
12:22:21.001 ->          .;;;;;;;;;`                  ,;;;;;;;;:         
12:22:21.001 ->                                                          
12:22:21.035 ->                                                          
12:22:21.035 ->                                                          
12:22:21.035 ->                                                          
12:22:21.035 ->     ;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;   
12:22:21.035 ->     ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;  
12:22:21.035 ->    ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,`;, ;;  ;;  
12:22:21.035 ->    ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;`;, ;;  ;;. 
12:22:21.070 ->    ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;`;;;, ;;  ;;` 
12:22:21.070 ->   ,;;;;;  ;;`;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;  
12:22:21.070 ->   ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;  
12:22:21.070 ->   ;;   ;; ;;  ;;` ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   
12:22:21.070 -> 
12:22:21.070 -> disconnecting.

次回はこのスケッチを元にセンサーで取得したデータをクラウドにアップしてみます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?