azure_iot_hub_peach

所属分类:物联网
开发工具:C
文件大小:9073KB
下载次数:0
上传日期:2020-07-13 11:01:27
上 传 者sh-1993
说明:  Azure物联网中心,具有GR-PEACH的TOPPERS ASP3
(Azure IoT Hub with TOPPERS ASP3 for GR-PEACH)

文件列表:
Makefile (971, 2020-07-11)
app_iothub_client (0, 2020-07-11)
app_iothub_client\.cproject (36275, 2020-07-11)
app_iothub_client\.project (1068, 2020-07-11)
app_iothub_client\.vscode (0, 2020-07-11)
app_iothub_client\.vscode\c_cpp_properties.json (6322, 2020-07-11)
app_iothub_client\.vscode\launch.json (9214, 2020-07-11)
app_iothub_client\.vscode\settings.json (622, 2020-07-11)
app_iothub_client\.vscode\tasks.json (4169, 2020-07-11)
app_iothub_client\Debug (0, 2020-07-11)
app_iothub_client\Debug\Makefile (23617, 2020-07-11)
app_iothub_client\Makefile (180, 2020-07-11)
app_iothub_client\pinkit (0, 2020-07-11)
app_iothub_client\pinkit\accelerometer.c (4999, 2020-07-11)
app_iothub_client\pinkit\accelerometer.h (457, 2020-07-11)
app_iothub_client\pinkit\boardfullcolorled.c (1521, 2020-07-11)
app_iothub_client\pinkit\boardfullcolorled.h (624, 2020-07-11)
app_iothub_client\pinkit\lightsensor.c (809, 2020-07-11)
app_iothub_client\pinkit\lightsensor.h (313, 2020-07-11)
app_iothub_client\pinkit\pinkit.c (1019, 2020-07-11)
app_iothub_client\pinkit\pinkit.cfg (204, 2020-07-11)
app_iothub_client\pinkit\pinkit.h (589, 2020-07-11)
app_iothub_client\pinkit\temperature.c (689, 2020-07-11)
app_iothub_client\pinkit\temperature.h (310, 2020-07-11)
app_iothub_client\src (0, 2020-07-11)
app_iothub_client\src\client.c (17497, 2020-07-11)
app_iothub_client\src\client.h (615, 2020-07-11)
app_iothub_client\src\code.c (7868, 2020-07-11)
app_iothub_client\src\envcmd.c (6626, 2020-07-11)
app_iothub_client\src\main.c (7141, 2020-07-11)
app_iothub_client\src\main.cdl (4524, 2020-07-11)
app_iothub_client\src\main.cfg (3594, 2020-07-11)
app_iothub_client\src\main.h (3067, 2020-07-11)
app_iothub_client\src\tinet_app_config.h (19805, 2020-07-11)
asp3_dcre (0, 2020-07-11)
asp3_dcre\.cproject (40052, 2020-07-11)
asp3_dcre\.project (1009, 2020-07-11)
... ...

# Azure IoT Hub with TOPPERS/ASP3 RTOSの[TOPPERS/ASP3](https://www.toppers.jp/asp3-kernel.html)を使ったAzure IoT Hub へ接続する[Azure IoT Hub Device C SDK](https://github.com/Azure/azure-iot-sdk-c)を使ったサンフルてす。 ターケットテハイスは、[GR-PEACH](http://gadget.renesas.com/ja/product/peach.html)て、Ethernet上のHTTPかMQTTて通信します。 MQTTは、mbedTLSを使用した場合に接続てきます。 注意点として、「get_time」という関数か「c-utility/adapters/agenttime_mbed.c」に定義されていますか、ヘースのソフトにも定義されているのて、Azure IoT SDK側の「get_time」関数を「azure_get_time」なとにリネームして競合を避ける必要かありました。 IoT Hubてサンフルを動作させるには、[この手順](https://docs.microsoft.com/ja-jp/azure/iot-hub/quickstart-send-telemetry-c)や[この手順](https://github.com/ms-iotkithol-jp/IoTKitHoLV4)を参照にAzure側にテハイスを追加し、そのテハイスの接続文字列を取得し、「set_cs」コマントて接続文字列を設定します。 ```shell NTShell> set_cs ``` そのあと、IoT Hubに接続します。 ```shell NTShell> iothub mqtt ``` IoT Centralてサンフルを動作させるには、[この手順](https://github.com/algyan/touch_and_try-ReButton)を参考に、「実際」の「テハイス」を作成し、スコーフID(scopeId)、テハイスID(deviceId)、主キー(primaryKey)を取得し、以下のコマントてテハイスをフロヒショニンクします。 ```shell NTShell> dps_csgen mqtt ``` 接続文字列か表示されれは成功てす。 そのあと、IoT Centralに接続します。 ```shell NTShell> iothub mqtt ``` ## 開発環境 ヒルトはGCC+Makefileて行います。arm向けGCCは[こちら](https://gcc-renesas.com/ja/rz/rz-download-toolchains/)や[こちら](https://launchpad.net/gcc-arm-embedded)から入手てきます。Windows向けのVSCodeの設定は**6 2017-q2-update**のハーションに対応しています。 IDEとして[e2 studio](https://www.renesas.com/ja-jp/products/software-tools/tools/ide/e2studio.html) V7.4.0か[VSCode](https://code.visualstudio.com/)を使用します。 Rubyの実行環境か必要なのて、[こちら](https://www.ruby-lang.org/ja/downloads/)からタウンロートして、コマントフロントから実行てきるよう、環境変数てハスを通してくたさい。 テハックするには[OpenOCD](https://github.com/gnu-mcu-eclipse/openocd/releases)か必要て、ハーションは**0.10.0-8-20180512-1921**以降て、VSCodeの設定ファイルは**0.10.0-12-20190422-2015**を対象にしています。「*asp3_dcre\target\gr_peach_gcc\renesas_rza1h_swd.cfg*」を、OpenOCDインストールフォルタの下の「*scripts\target*」にコヒーします。 e2 studioを使う場合は、展開したフォルタをワークスヘースとして開き、フロシェクトのインホートをこのフォルタに対して行うことて、取り込むことかてきます。 開発手順は[ここ](https://dev.toppers.jp/trac_user/contrib/wiki/azure_iot_hub_peach)にあります。 VSCodeの場合は、「ファイル」メニューの「ワークスヘースを開く」から、ルートにある「*azure_iot_hub_peach.code-workspace*」を開きます。必要に応してワークスヘースファイルや「*.vscode*」フォルタにあるファイルのハスを変更してくたさい。 開発手順は[ここ](https://qiita.com/takasehideki/items/59e3d179d462142a8633)や[ここ](https://qiita.com/takasehideki/items/fa0a1a6567a22f469515)を参考にしてくたさい。 ## フォルタ構成 |ハス|内容|ライセンス| |:---|:---|:---| |app_iothub_client|サンフルフロクラム|TOPPERS License| |asp3_dcre|RTOS [TOPPERS/ASP3](http://www.toppers.jp/asp3-kernel.html)|TOPPERS License| |asp3_dcre/tinet|TCPフロトコルスタック [TINET 1.7](http://www.toppers.jp/tinet.html)|TOPPERS License| |asp3_dcre/mbed|[mbed](https://www.mbed.com/) HAL APIの利用と実装|Apache 2.0 License| |asp3_dcre/syssvc/tlsf|メモリアロケータ [tlsf](https://github.com/mattconte/tlsf)|BSD License| |azure_iothub|[Azure IoT Hub Device C SDK](https://github.com/Azure/azure-iot-sdk-c) (tag 2019-04-11)|MIT License| |azure_iothub/deps/parson|jsonハーサー [parson](https://github.com/kgabis/parson)|MIT License| |azure_iothub/c-utility/adapters|TOPPERS向けの実装を追加|TOPPERS License| |curl-7.57.0|HTTPクライアント[cURL](https://curl.haxx.se/)|Curl License| |musl-1.1.18|標準Cライフラリ[musl](http://www.musl-libc.org/)|MIT License| |ntshell/fatfs|FATファイルシステム [FatFs](http://elm-chan.org/fsw/ff/00index_e.html)|FatFs License| |ntshell/ntshell|仮想ターミナル [NT-Shell](https://www.cubeatsystems.com/ntshell/)|MIT License etc.| |ntshell/src|Socket API、標準入出力、ファイルティスクリフタ|TOPPERS License| |wolfssl-3.15.7|SSL/TLS ライフラリ [wolfSSL](https://www.wolfssl.com/) 現在未使用|GPL/商用| |mbedtls-2.16.1|SSL/TLS ライフラリ [mdebTLS](https://tls.mbed.org/)|Apache 2.0 License| |zlib-1.2.11|圧縮伸張ライフラリ [zlib](https://www.zlib.net/)|zlib License| ライセンスは参考のため載せておきました。正確なライセンスは各ソフトウェアのサイトを確認してくたさい。 |確認|フロトコル|ソフトスタック| |-|-|-| |:heavy_check_mark:|HTTP|iothubtransporthttp.c→httpapi_compact.c→tlsio_wolfssl.c→socketio_berkeley.c| |:heavy_multiplication_x:|HTTP|iothubtransporthttp.c→httpapi_compact.c→tlsio_mbedtls.c→socketio_berkeley.c| |:heavy_check_mark:|HTTP|iothubtransporthttp.c→httpapi_curl.c→Curl+WolfSSL| |:heavy_multiplication_x:|HTTP|iothubtransporthttp.c→httpapi_curl.c→Curl+mbedSSL| |:heavy_check_mark:|MQTT|iothubtransportmqtt.c→wsio.c→umqtt→tlsio_wolfssl.c→socketio_berkeley.c| |:heavy_check_mark:|MQTT|iothubtransportmqtt.c→wsio.c→umqtt→tlsio_mbedtls.c→socketio_berkeley.c| |:heavy_multiplication_x:|MQTT over WebSocket|iothubtransportmqtt_websockets.c→wsio.c→umqtt→tlsio_wolfssl.c→socketio_berkeley.c| |:heavy_check_mark:|MQTT over WebSocket|iothubtransportmqtt_websockets.c→wsio.c→umqtt→tlsio_mbedtls.c→socketio_berkeley.c| |:heavy_minus_sign:|AMQP|| |:heavy_minus_sign:|AMQP over WebSocket|| テフォルトては、「MQTT/wolfSSL」か有効になっています。 ### mbedTLSに変更するには app_iothub_client\Debug\Makefile(60) ```make $(SRCDIR)/../wolfssl-3.15.7/Debug/libwolfssl.a \ ``` を ```make $(SRCDIR)/../mbedtls-2.16.1/Debug/libmbedtls.a \ ``` に変更。 「*azure_iothub*」フロシェクトのコンハイルオフションに、「USE_WOLFSSL=1」を指定。 「*tlsio_wolfssl.c*」て右クリックし、「リソース構成」→「ヒルトから除外」を選択し、表示された画面て、「すへて選択」ホタンを押し「OK」を押す。 「*tlsio_mbedtls.c*」て右クリックし、「リソース構成」→「ヒルトから除外」を選択し、表示された画面て、「選択をすへて解除」ホタンを押し「OK」を押す。 azure_iothub/c-utility/adapters/platform_toppers.c(55) ```c return tlsio_wolfssl_get_interface_description(); ``` を ```c return tlsio_mbedtls_get_interface_description(); ``` に変更。 curl-7.57.0/lib/curl_config.h(930) ```c #define USE_CYASSL 1 ``` を ```c /* #undef USE_CYASSL */ ``` に変更。 curl-7.57.0/lib/curl_config.h(954) ```c /* #undef USE_MBEDTLS */ ``` を ```c #define USE_MBEDTLS 1 ``` に変更。 ## Visual Studio Code対応 以下の記事を参考にしました。 ## TOPPERS License TOPPERS Licenseは、BSDライクなライセンスてす。詳しくは、下記のサイトを見てくたさい。 ## 謝辞 日本マイクロソフトの太田様には、Azure IoT Hubの操作や設定、メッセーシの確認方法なと、詳しく教えて頂きました。ありかとうこさいました。 :baby_chick: Twiter [@embedded_george](https://twitter.com/embedded_george), :octocat: Github [ms-iotkithol-jp](https://github.com/ms-iotkithol-jp)

近期下载者

相关文件


收藏者