diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client over TLS.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client over TLS.rst index c19959e..263b262 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client over TLS.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client over TLS.rst @@ -13,7 +13,7 @@ Materials Example ------- -In this example, Ameba connect to a MQTT broker using TLS authentication. Then send messages as a publisher and receive messages as a subscriber. +In this example, Ameba connect to a MQTT broker using TLS authentication. Then, send messages as a publisher and receive messages as a subscriber. Open example at “File” -> “Examples” -> “AmebaMQTTClient” -> “MQTT_TLS” diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client to Communicate with Broker.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client to Communicate with Broker.rst deleted file mode 100644 index 44bf103..0000000 --- a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client to Communicate with Broker.rst +++ /dev/null @@ -1,261 +0,0 @@ -Set up MQTT Client to Communicate with Broker -============================================== - -.. contents:: - :local: - :depth: 2 - -Materials ---------- - -- `AMB82-mini `_ x 1 - -Example -------- - -MQTT (Message Queuing Telemetry Transport) is a protocol proposed by IBM and Eurotech. The introduction in MQTT Official Website: -MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.We can say MQTT is a protocol designed for IoT. MQTT is based on TCP/IP and transmits/receives data via publish/subscribe. - -Please refer to the figure below: - -|image01| - -In the operation of MQTT, there are several roles: - -- Publisher: Usually publishers are the devices equipped with sensors - (ex. Ameba). Publishers uploads the data of the sensors to - MQTT-Broker, which serves as a database with MQTT service. - -- Subscriber: Subscribers are referred to the devices which receive and - observe messages, such as a laptop or a mobile phone. - -- Topic: Topic is used to categorize the messages, for example the - topic of a message can be “PM2.5” or “Temperature”. Subscribers can - choose messages of which topics they want to receive. - -In this page, there are 4 examples that connect Ameba to MQTT-Broker. -Then send messages as publisher and receive messages from MQTT-Broker as -subscriber. - -1. MQTT_Basic - -2. MQTT_Auth - -3. MQTT_Publish_In_Callback - -4. MQTT_Image - -**MQTT_Basic example** - -| Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> “MQTT_Basic” -| Please modify some WiFi-related parameter and some information related to MQTT: - -|image02| - -- “ssid” is the network SSID for internet access. - -- “pass” is the network password for internet access. - -- “mqttServer” refers to the MQTT-Broker, there is free MQTT sandbox - “test.mosquitto.org” for testing. - -- “clientId” is an identifier for MQTT-Broker to identify the connected - device. - -- “publishTopic” is the topic of the published message in the example - it is “outTopic”. The devices that subscribed to “outTopic” will - receive the message. - -- “publishPayload” is the content to be published. - -- “subscribeTopic” is to tell MQTT-broker which topic to subscribe to - by the board. - -Next, compile the code and upload it to Ameba. Press the reset button, then open the serial monitor. - -|image03| - -After Ameba is connected to MQTT server, it sends the message “hello world” to “outTopic”. To see the message, another MQTT client needs to be set up. - -The “MQTT Explore” is an all-platform application that can be set as the MQTT client. Refer to the website http://mqtt-explorer.com/. - -Click “Connections” at top left to start a new connection setup. “Name” can be customized. Set “Host” as “test.mosquitto.org”. - -|image04| - -Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as “publishTopic” of the board. Click “ADD” then “BACK”. - -|image05| - -Click “CONNECT”. The “hello world” message show up at left side. At right side, under “Publish” use “inTopic” same as “sucribeTopic” of the board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. The board will receive the MQTT Explorer published raw message. Note, because of the host is a free public host, the board may receive unexpected messages. - -|image06| - -|image07| - -**MQTT_Auth example** - -| Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> “MQTT_Auth” -| Please modify some WiFi-related parameter and some information related to MQTT: - -|image08| - -- “mqttServer” refers to the MQTT-Broker, there is free MQTT auth host - provided by amebaiot homepage “cloud.amebaiot.com”. Please visit - https://www.amebaiot.com/en/cloud-getting-started/ for account setup. - -- “clientId” is an identifier for MQTT-Broker to identify the connected - device. In this case, it is the registered device name. Refer to - https://www.amebaiot.com/en/cloud-service/. - -- “clientUser” is the authentication username. In this case, it is the - login username of Realtek IoT/Wi-Fi MCU Solutions website. Note, it - will be unable to receive message if use the email as “clientUser”. - -- “clientPass” is the authentication password. In this case, it is the - login password of Realtek IoT/Wi-Fi MCU Solutions website. - -- The other parameters are same as previous. - -Next, compile the code and upload it to Ameba. Press the reset button, then open the serial monitor. After Ameba is connected to MQTT server, it sends the message “hello world” to “outTopic”. To see the message, another MQTT client needs to be set up. - -Start the MQTT Explore, and setup the auth connection. - -Click “Connections” at top left to start a new connection setup. “Name” can be customized. Set “Host” as “cloud.amebaiot.com”. “Username” and “Password” are same as “clientUser” and “clientPass”. - -|image09| - -Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as “publishTopic” of the board. Click “ADD” then “BACK”. - -Click “CONNECT”. The “hello world” message show up at left side. At right side, under “Publish” use “inTopic” same as “sucribeTopic” of the board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. The board will receive the MQTT Explorer published raw message. Note, “hello world” sometimes is not shown up because the boards connect to MQTT broker before the MQTT Explorer. - -|image10| - -|image11| - -**MQTT_Publish_In_Callback example** - -Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> -“MQTT_Publish_In_Callback” - -Please modify some WiFi-related parameter and some information related -to MQTT: - -- All parameters are same as MQTT_Auth example. - -Next, compile the code and upload it to Ameba. Press the reset button, -then open the serial monitor. After Ameba is connected to MQTT server, -it sends the message “hello world” to “outTopic”. To see the message, -another MQTT client needs to be set up. - -Start the MQTT Explore, and setup the auth connection. All setting is -same as MQTT_Auth example. - -Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as -“publishTopic” of the board. Click “ADD” then “BACK”. - -Click “CONNECT”. The “hello world” message show up at left side. At -right side, under “Publish” use “inTopic” same as “sucribeTopic” of the -board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. -The board will receive the MQTT Explorer published raw message. Then -publish it from the board side and MQTT Explorer will receive at the -left side. Note, “hello world” sometimes is not shown up because the -boards connect to MQTT broker before the MQTT Explorer. - -|image12| - -|image13| - -**MQTT_Image example** - -Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> -“MQTT_Image” - -Please modify WiFi SSID and password according to your network. - -- “ssid” is the network SSID for internet access. - -- “pass” is the network password for internet access. - -- “mqttServer” refers to the MQTT-Broker, we will be using "broker.mqttgo.io" for this example. - -- “clientId” is an identifier for MQTT-Broker to identify the connected - device. - -- “publishTopic” is the topic of the published message in the example - it is “outTopic/Msg”. The devices that subscribed to “outTopic” will - receive the message. - -- “publishPayload” is the content to be published. - -- “subscribeTopic” is to tell MQTT-broker which topic to subscribe to - by the board. - -- Image taken will be publish to "outTopic/Img". - -Go to `MQTTGO.io `_, and connect to server. - -Subscribe to "outTopic/Msg" and "outTopic/Img", while the publish topic is set to "inTopic/Msg". - -|image14| - -Next, compile and upload the example code to Ameba. After Ameba is connected to MQTT server, -it publishes the message “hello world” to “outTopic/Msg” and an image to "outTopic/Img". - -.. note :: You may redefine the topics for your own message and image publishing - -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image01.png - :width: 940 px - :height: 617 px - -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image02.png - :width: 498 px - :height: 182 px - -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image03.png - :width: 662 px - :height: 438 px - -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image04.png - :width: 1002 px - :height: 654 px - -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image05.png - :width: 996 px - :height: 655 px - -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image06.png - :width: 1000 px - :height: 655 px - -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image07.png - :width: 449 px - :height: 142 px - -.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image08.png - :width: 524 px - :height: 217 px - -.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image09.png - :width: 998 px - :height: 652 px - -.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image10.png - :width: 997 px - :height: 667 px - -.. |image11| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image11.png - :width: 538 px - :height: 155 px - -.. |image12| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image12.png - :width: 1001 px - :height: 653 px - -.. |image13| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image13.png - :width: 548 px - :height: 151 px - -.. |image14| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image14.png - :width: 997 px - :height: 849 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection with Publish in Callback.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection with Publish in Callback.rst new file mode 100644 index 0000000..e6590ca --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection with Publish in Callback.rst @@ -0,0 +1,95 @@ +Set up MQTT Client-Broker Authenticated Connection with Publish in Callback +=========================================================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- + +MQTT (Message Queuing Telemetry Transport) is a protocol proposed by IBM and Eurotech. The introduction in MQTT Official Website: +MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.We can say MQTT is a protocol designed for IoT. MQTT is based on TCP/IP and transmits/receives data via publish/subscribe. + +Please refer to the figure below: + +|image01| + +In the operation of MQTT, there are several roles: + +- Publisher: Usually publishers are the devices equipped with sensors + (ex. Ameba). Publishers uploads the data of the sensors to + MQTT-Broker, which serves as a database with MQTT service. + +- Subscriber: Subscribers are referred to the devices which receive and + observe messages, such as a laptop or a mobile phone. + +- Topic: Topic is used to categorize the messages, for example the + topic of a message can be “PM2.5” or “Temperature”. Subscribers can + choose messages of which topics they want to receive. + +This example shows how to connect Ameba to MQTT-Broker with authentication. +Then, send messages as publisher and receive messages from MQTT-Broker as +subscriber. + +**MQTT_Publish_In_Callback example** + +Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> +“MQTT_Publish_In_Callback” + +Please modify some WiFi-related parameter and some information related +to MQTT: + +|image08| + +- All parameters are same as MQTT_Auth example. + +Next, compile the code and upload it to Ameba. Press the reset button, +then open the serial monitor. After Ameba is connected to MQTT server, +it sends the message “hello world” to “outTopic”. To see the message, +another MQTT client needs to be set up. + +Start the MQTT Explore, and setup the auth connection. All setting is +same as MQTT_Auth example. + +|image09| + +Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as +“publishTopic” of the board. Click “ADD” then “BACK”. + +Click “CONNECT”. The “hello world” message show up at left side. At +right side, under “Publish” use “inTopic” same as “subscribeTopic” of the +board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. +The board will receive the MQTT Explorer published raw message. Then +publish it from the board side and MQTT Explorer will receive at the +left side. Note, “hello world” sometimes is not shown up because the +boards connect to MQTT broker before the MQTT Explorer. + +|image12| + +|image13| + +.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image01.png + :width: 940 px + :height: 617 px + +.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image08.png + :width: 524 px + :height: 217 px + +.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image09.png + :width: 998 px + :height: 652 px + +.. |image12| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image12.png + :width: 1001 px + :height: 653 px + +.. |image13| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image13.png + :width: 548 px + :height: 151 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection.rst new file mode 100644 index 0000000..12368cd --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Authenticated Connection.rst @@ -0,0 +1,98 @@ +Set up MQTT Client-Broker Authenticated Connection +================================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- + +MQTT (Message Queuing Telemetry Transport) is a protocol proposed by IBM and Eurotech. The introduction in MQTT Official Website: +MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.We can say MQTT is a protocol designed for IoT. MQTT is based on TCP/IP and transmits/receives data via publish/subscribe. + +Please refer to the figure below: + +|image01| + +In the operation of MQTT, there are several roles: + +- Publisher: Usually publishers are the devices equipped with sensors + (ex. Ameba). Publishers uploads the data of the sensors to + MQTT-Broker, which serves as a database with MQTT service. + +- Subscriber: Subscribers are referred to the devices which receive and + observe messages, such as a laptop or a mobile phone. + +- Topic: Topic is used to categorize the messages, for example the + topic of a message can be “PM2.5” or “Temperature”. Subscribers can + choose messages of which topics they want to receive. + +This example shows how to connect Ameba to MQTT-Broker with authentication. +Then send messages as publisher and receive messages from MQTT-Broker as +subscriber. + +**MQTT_Auth example** + +| Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> “MQTT_Auth” +| Please modify some WiFi-related parameter and some information related to MQTT: + +|image08| + +- “mqttServer” refers to the MQTT-Broker, there is free MQTT auth host + provided by amebaiot homepage “cloud.amebaiot.com”. Please visit + https://www.amebaiot.com/en/cloud-getting-started/ for account setup. + +- “clientId” is an identifier for MQTT-Broker to identify the connected + device. In this case, it is the registered device name. Refer to + https://www.amebaiot.com/en/cloud-service/. + +- “clientUser” is the authentication username. In this case, it is the + login username of Realtek IoT/Wi-Fi MCU Solutions website. Note, it + will be unable to receive message if use the email as “clientUser”. + +- “clientPass” is the authentication password. In this case, it is the + login password of Realtek IoT/Wi-Fi MCU Solutions website. + +- The other parameters are same as previous. + +Next, compile the code and upload it to Ameba. Press the reset button, then open the serial monitor. After Ameba is connected to MQTT server, it sends the message “hello world” to “outTopic”. To see the message, another MQTT client needs to be set up. + +Start the MQTT Explore, and setup the auth connection. + +Click “Connections” at top left to start a new connection setup. “Name” can be customized. Set “Host” as “cloud.amebaiot.com”. “Username” and “Password” are same as “clientUser” and “clientPass”. + +|image09| + +Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as “publishTopic” of the board. Click “ADD” then “BACK”. + +Click “CONNECT”. The “hello world” message show up at left side. At right side, under “Publish” use “inTopic” same as “subscribeTopic” of the board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. The board will receive the MQTT Explorer published raw message. Note, “hello world” sometimes is not shown up because the boards connect to MQTT broker before the MQTT Explorer. + +|image10| + +|image11| + +.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image01.png + :width: 940 px + :height: 617 px + +.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image08.png + :width: 524 px + :height: 217 px + +.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image09.png + :width: 998 px + :height: 652 px + +.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image10.png + :width: 997 px + :height: 667 px + +.. |image11| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image11.png + :width: 538 px + :height: 155 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection for Image Publishing.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection for Image Publishing.rst new file mode 100644 index 0000000..baaba1b --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection for Image Publishing.rst @@ -0,0 +1,84 @@ +Set up MQTT Client-Broker Basic Connection for Image Publishing +=============================================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- + +MQTT (Message Queuing Telemetry Transport) is a protocol proposed by IBM and Eurotech. The introduction in MQTT Official Website: +MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.We can say MQTT is a protocol designed for IoT. MQTT is based on TCP/IP and transmits/receives data via publish/subscribe. + +Please refer to the figure below: + +|image01| + +In the operation of MQTT, there are several roles: + +- Publisher: Usually publishers are the devices equipped with sensors + (ex. Ameba). Publishers uploads the data of the sensors to + MQTT-Broker, which serves as a database with MQTT service. + +- Subscriber: Subscribers are referred to the devices which receive and + observe messages, such as a laptop or a mobile phone. + +- Topic: Topic is used to categorize the messages, for example the + topic of a message can be “PM2.5” or “Temperature”. Subscribers can + choose messages of which topics they want to receive. + +This example shows how to connect Ameba to MQTT-Broker. +Then, send messages as publisher and receive messages from MQTT-Broker as +subscriber. + +**MQTT_Image example** + +Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> +“MQTT_Image” + +Please modify WiFi SSID and password according to your network. + +- “ssid” is the network SSID for internet access. + +- “pass” is the network password for internet access. + +- “mqttServer” refers to the MQTT-Broker, we will be using "broker.mqttgo.io" for this example. + +- “clientId” is an identifier for MQTT-Broker to identify the connected + device. + +- “publishTopic” is the topic of the published message in the example + it is “outTopic/Msg”. The devices that subscribed to “outTopic” will + receive the message. + +- “publishPayload” is the content to be published. + +- “subscribeTopic” is to tell MQTT-broker which topic to subscribe to + by the board. + +- Image taken will be publish to "outTopic/Img". + +Go to `MQTTGO.io `_, and connect to server. + +Subscribe to "outTopic/Msg" and "outTopic/Img", while the publish topic is set to "inTopic/Msg". + +|image14| + +Next, compile and upload the example code to Ameba. After Ameba is connected to MQTT server, +it publishes the message “hello world” to “outTopic/Msg” and an image to "outTopic/Img". + +.. note :: You may redefine the topics for your own message and image publishing + +.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image01.png + :width: 940 px + :height: 617 px + +.. |image14| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image14.png + :width: 997 px + :height: 849 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Generative AI Vision with MQTT.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection with Generative AI Vision.rst similarity index 94% rename from source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Generative AI Vision with MQTT.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection with Generative AI Vision.rst index 12cbc69..7d8c2c2 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Generative AI Vision with MQTT.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection with Generative AI Vision.rst @@ -1,5 +1,5 @@ -Generative AI Vision with MQTT -============================== +Set up MQTT Client-Broker Basic Connection with Generative AI Vision +==================================================================== .. contents:: :local: diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection.rst new file mode 100644 index 0000000..f2c0a94 --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/Set up MQTT Client-Broker Basic Connection.rst @@ -0,0 +1,114 @@ +Set up MQTT Client-Broker Basic Connection +========================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- + +MQTT (Message Queuing Telemetry Transport) is a protocol proposed by IBM and Eurotech. The introduction in MQTT Official Website: +MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.We can say MQTT is a protocol designed for IoT. MQTT is based on TCP/IP and transmits/receives data via publish/subscribe. + +Please refer to the figure below: + +|image01| + +In the operation of MQTT, there are several roles: + +- Publisher: Usually publishers are the devices equipped with sensors + (ex. Ameba). Publishers uploads the data of the sensors to + MQTT-Broker, which serves as a database with MQTT service. + +- Subscriber: Subscribers are referred to the devices which receive and + observe messages, such as a laptop or a mobile phone. + +- Topic: Topic is used to categorize the messages, for example the + topic of a message can be “PM2.5” or “Temperature”. Subscribers can + choose messages of which topics they want to receive. + +This example shows how to connect Ameba to MQTT-Broker. +Then, send messages as publisher and receive messages from MQTT-Broker as +subscriber. + +**MQTT_Basic example** + +| Open the MQTT example “File” -> “Examples” -> “AmebaMQTTClient” -> “MQTT_Basic” +| Please modify some WiFi-related parameter and some information related to MQTT: + +|image02| + +- “ssid” is the network SSID for internet access. + +- “pass” is the network password for internet access. + +- “mqttServer” refers to the MQTT-Broker, there is free MQTT sandbox + “test.mosquitto.org” for testing. + +- “clientId” is an identifier for MQTT-Broker to identify the connected + device. + +- “publishTopic” is the topic of the published message in the example + it is “outTopic”. The devices that subscribed to “outTopic” will + receive the message. + +- “publishPayload” is the content to be published. + +- “subscribeTopic” is to tell MQTT-broker which topic to subscribe to + by the board. + +Next, compile the code and upload it to Ameba. Press the reset button, then open the serial monitor. + +|image03| + +After Ameba is connected to MQTT server, it sends the message “hello world” to “outTopic”. To see the message, another MQTT client needs to be set up. + +The “MQTT Explore” is an all-platform application that can be set as the MQTT client. Refer to the website http://mqtt-explorer.com/. + +Click “Connections” at top left to start a new connection setup. “Name” can be customized. Set “Host” as “test.mosquitto.org”. + +|image04| + +Click “ADVANCED” at bottom for topic setup. Use “outTopic” that same as “publishTopic” of the board. Click “ADD” then “BACK”. + +|image05| + +Click “CONNECT”. The “hello world” message show up at left side. At right side, under “Publish” use “inTopic” same as “subscribeTopic” of the board. Choose “raw” and input “Text hello Ameba”, then click “PUBLISH”. The board will receive the MQTT Explorer published raw message. Note, because of the host is a free public host, the board may receive unexpected messages. + +|image06| + +|image07| + +.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image01.png + :width: 940 px + :height: 617 px + +.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image02.png + :width: 498 px + :height: 182 px + +.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image03.png + :width: 662 px + :height: 438 px + +.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image04.png + :width: 1002 px + :height: 654 px + +.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image05.png + :width: 996 px + :height: 655 px + +.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image06.png + :width: 1000 px + :height: 655 px + +.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/MQTT/Set_up_Client/image07.png + :width: 449 px + :height: 142 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/index.rst b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/index.rst index a9ba0d2..ba75a84 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/index.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/MQTT/index.rst @@ -5,5 +5,8 @@ MQTT :maxdepth: 1 Set up MQTT Client over TLS - Set up MQTT Client to Communicate with Broker - Generative AI Vision with MQTT + Set up MQTT Client-Broker Authenticated Connection with Publish in Callback + Set up MQTT Client-Broker Authenticated Connection + Set up MQTT Client-Broker Basic Connection for Image Publishing + Set up MQTT Client-Broker Basic Connection with Generative AI Vision + Set up MQTT Client-Broker Basic Connection diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Effects.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Effects.rst similarity index 83% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Effects.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Effects.rst index 74ab0e3..fa92536 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Effects.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Effects.rst @@ -48,22 +48,22 @@ The NS algorithm can reduce the loudness of background noise and is able to sign The AGC algorithm can dynamically adjust the gain and sensitivity to maintain the audio signal at a target loudness level. The target reference level of the AGC can be adjusted with the second argument of configMicAGC and configSpkAGC, with 0 representing 0 dBFS the loudest level, and 30 representing -30 dBFS the softest level. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image01.png :width: 614 px :height: 488 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image02.png :width: 770 px :height: 427 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image03.png :width: 768 px :height: 832 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image04.png :width: 684 px :height: 817 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Effects/image05.png :width: 684 px :height: 817 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Basic.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Volume Adjust.rst similarity index 65% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Basic.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Volume Adjust.rst index 6d0b171..abb5f00 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio Basic.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Audio Volume Adjust.rst @@ -1,5 +1,5 @@ -Audio Basic -=========== +Audio Volume Adjust +=================== .. contents:: :local: @@ -17,11 +17,6 @@ Example ------- In this example, we will use the Ameba Pro2 board to playback audio recorded by the onboard analogue microphone or an external PDM (Pulse Density Modulation) microphone. -The following examples are relevant to this guide. - -1. LoopbackTest -2. AudioVolumeAdjust - Connect the audio jack and potentiometers to the Ameba board as shown in the diagram. |image01| @@ -30,23 +25,23 @@ Alternatively, connect the audio jack, potentiometers, and PDM Microphone as sho |image02| -Open one of the Audio examples in “File” -> “Examples” -> “AmebaMultimedia” -> “Audio”. +Open one of the Audio examples in “File” -> “Examples” -> “AmebaMultimedia” -> “Audio” -> "AudioVolumeAdjust". |image03| Compile the code and upload it to Ameba. Plug in a pair of wired earbuds into the audio jack. After pressing the Reset button, you should be able to hear sounds picked up by the onboard microphone replayed through the earbuds. -In the “AudioVolumeAdjust” example, turning the potentiometers will adjust either the input volume of the microphone or the output volume of the audio jack. +In this “AudioVolumeAdjust” example, turning the potentiometers will adjust either the input volume of the microphone or the output volume of the audio jack. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image01.png :width: 719 px :height: 577 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image02.png :width: 806 px :height: 471 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image03.png :width: 768 px :height: 832 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Echo Cancellation.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Echo Cancellation.rst similarity index 75% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Echo Cancellation.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Echo Cancellation.rst index 4c34b4c..b47d44c 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Echo Cancellation.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Echo Cancellation.rst @@ -103,66 +103,66 @@ Code Reference -------------- The AEC algorithm is limited to 8 kHz and 16 kHz sample rates. The strength level of the AEC effect can be adjusted with the second argument of configMicAEC, with 0 being the weakest and 17 being the strongest. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image01.png :width: 586 px :height: 610 px -.. |image01pdm| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image1pdm.png +.. |image01pdm| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image1pdm.png :width: 586 px :height: 442 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image02.png :width: 768 px :height: 832 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image03.png :width: 684 px :height: 817 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image04.png :width: 424 px :height: 434 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image05.png :width: 530 px :height: 391 px -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image06.png +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image06.png :width: 727 px :height: 477 px -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image07.png +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image07.png :width: 727 px :height: 477 px -.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image08.png +.. |image08| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image08.png :width: 727 px :height: 477 px -.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image09.png +.. |image09| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image09.png :width: 586 px :height: 503 px -.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image10.png +.. |image10| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image10.png :width: 586 px :height: 503 px -.. |image11| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image11.png +.. |image11| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image11.png :width: 586 px :height: 503 px -.. |image12| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image12.png +.. |image12| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image12.png :width: 586 px :height: 503 px -.. |image13| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image13.png +.. |image13| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image13.png :width: 432 px :height: 482 px -.. |image14| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image14.png +.. |image14| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image14.png :width: 728 px :height: 564 px -.. |image15| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image15.png +.. |image15| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Echo_Cancellation/image15.png :width: 989 px :height: 492 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Loopback Test.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Loopback Test.rst new file mode 100644 index 0000000..9bfc095 --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/Loopback Test.rst @@ -0,0 +1,46 @@ +Loopback Test +============= + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 +- 3.5mm TRS/TRRS breakout x 1 (e.g., Adafruit 2791 / Sparkfun 11570) +- Adafruit PDM Microphone Breakout x 1 [Optional] +- Potentiometer x 2 + +Example +------- +In this example, we will use the Ameba Pro2 board to playback audio recorded by the onboard analogue microphone or an external PDM (Pulse Density Modulation) microphone. + +Connect the audio jack to the Ameba board as shown in the diagram, you may ignore the potentiometers connection for this example. + +|image01| + +Alternatively, connect the audio jack and PDM Microphone as shown in the diagram below if you would like to use a digital microphone, you may ignore the potentiometers connection for this example. + +|image02| + +Open one of the Audio examples in “File” -> “Examples” -> “AmebaMultimedia” -> “Audio” -> "LoopbackTest". + +|image03| + +Compile the code and upload it to Ameba. + +Plug in a pair of wired earbuds into the audio jack. After pressing the Reset button, you should be able to hear sounds picked up by the onboard microphone replayed through the earbuds. + +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image01.png + :width: 719 px + :height: 577 px + +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image02.png + :width: 806 px + :height: 471 px + +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Audio_Basic/image03.png + :width: 768 px + :height: 832 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTP Audio Stream.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTP Audio Stream.rst similarity index 71% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTP Audio Stream.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTP Audio Stream.rst index 8a97076..b67184e 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTP Audio Stream.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTP Audio Stream.rst @@ -69,50 +69,50 @@ In the next window, click on the stream button, and VLC will begin streaming the Plug in a pair of wired earbuds into the audio jack, and you should hear the audio streamed from the computer. You can use the buttons in VLC to control the playback. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image01.png :width: 732 px :height: 763 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image02.png :width: 960 px :height: 1040 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image03.png :width: 684 px :height: 817 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image04.png :width: 424 px :height: 434 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image05.png :width: 530 px :height: 391 px -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image06.png +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image06.png :width: 727 px :height: 477 px -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image07.png +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image07.png :width: 727 px :height: 477 px -.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image08.png +.. |image08| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image08.png :width: 727 px :height: 477 px -.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image09.png +.. |image09| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image09.png :width: 586 px :height: 503 px -.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image10.png +.. |image10| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image10.png :width: 586 px :height: 503 px -.. |image11| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image11.png +.. |image11| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image11.png :width: 586 px :height: 503 px -.. |image12| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image12.png +.. |image12| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTP_Audio_Stream/image12.png :width: 586 px :height: 503 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTSP Audio Stream.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTSP Audio Stream.rst similarity index 80% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTSP Audio Stream.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTSP Audio Stream.rst index 5d2445d..af0c892 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/RTSP Audio Stream.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/RTSP Audio Stream.rst @@ -40,18 +40,18 @@ Code Reference -------------- The code can be modified to use the G.711 audio codec (PCMU/PCMA) instead of the default AAC. The G.711 audio codec is optimized for human speech and can maintain the clarity and understandability of spoken speech while reducing the data bandwidth needed. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image01.png :width: 960 px :height: 1040 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image02.png :width: 684 px :height: 817 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image03.png :width: 432 px :height: 482 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Audio_Stream/image04.png :width: 728 px :height: 564 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/index.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/index.rst new file mode 100644 index 0000000..a95727d --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Audio/index.rst @@ -0,0 +1,12 @@ +Audio +===== + +.. toctree:: + :maxdepth: 1 + + Audio Effects + Audio Volume Adjust + Echo Cancellation + Loopback Test + RTP Audio Stream + RTSP Audio Stream \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG Timelapse save to SD Card.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG Timelapse save to SD Card.rst new file mode 100644 index 0000000..b49cead --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG Timelapse save to SD Card.rst @@ -0,0 +1,36 @@ +Capture JPEG Timelapse save to SD Card +====================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 +- SD card x 1 + +Example +------- +In this example, we will be using Ameba Pro2 development board to capture a JPEG image from the on-board camera sensor (JX-F37P) and save it on the SD card. +The following examples shows different use cases for saving JPEG image to SD card. + +1. SDCardSaveJPEGTimelapse +2. SDCardSaveJPEGTimelapseWithNTPClient + +Open one of the CaptureJPEG examples in “File” -> “Examples” -> “AmebaMultimedia” -> ”CaptureJPEG” -> “SDCardSaveJPEGTimelapse”. + +|image01| + +Compile the code and upload it to Ameba. After pressing the Reset button, the Ameba Pro 2 board will start taking snapshot and save to SD card. + +The **SDCardSaveJPEGTimelapse** example will take a snapshot every second and save them on the SD card with the filename ”imageX.jpg”, where X is a number incrementing with each image. + +The **SDCardSaveJPEGTimelapseWithNTPClient** example is incorporated with NTPClient to be able to set the last modified time after images are saved to the SD Card. + +Disconnect power from the Ameba Pro 2 board, remove the SD card and connect it to a computer to view the contents. Depending on which example code was uploaded, there will be either a single image or multiple images saved on the SD card. + +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_save_to_SD_Card/image01.png + :width: 768 px + :height: 832 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP Continuous.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP Continuous.rst new file mode 100644 index 0000000..cca4b9c --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP Continuous.rst @@ -0,0 +1,53 @@ +Capture JPEG display over HTTP Continuous +========================================= + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- + +In this example, we will be using Ameba Pro2 development board to capture a JPEG image and send the image to a browser using HTTP. +The following examples shows different use cases of capturing JPEG images. + +For the “HTTPDisplayJPEGContinuous” example, use the Firefox browser and key in the IP address of the board in browser’s address bar after the board is connected to the WiFi to view the image. + +Open the example in “File” -> “Examples” -> “AmebaMultimedia” -> “CaptureJPEG” -> “HTTPDisplayJPEGContinuous”. + +|image01| + +In the highlighted code snippet, fill in the “ssid” with your WiFi network SSID and “pass” with the network password. + +|image02| + +Compile the code and upload it to Ameba. After pressing the Reset button, wait for the Ameba Pro 2 board to connect to the WiFi network. The board’s IP address will be shown in the Serial Monitor. + +|image03| + +Next, using a computer or a cell phone in the same network domain, open a browser window and enter the IP address shown in the Serial Monitor. + +|image04| + +By running “HTTPDisplayJPEGContinuous”, image will be taken repeatedly, and the image will be sent to the browser using HTTP, creating the effect of a video. Note that for the “HTTPDisplayJPEGContinuous” example, Firefox browser has been tested to work best. + +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image01.png + :width: 756 px + :height: 832 px + +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image02.png + :width: 756 px + :height: 832 px + +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image03.png + :width: 642 px + :height: 393 px + +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image04.png + :width: 675 px + :height: 323 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG display over HTTP.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP.rst similarity index 54% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG display over HTTP.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP.rst index c5f0751..7859c95 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG display over HTTP.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG display over HTTP.rst @@ -16,15 +16,9 @@ Example In this example, we will be using Ameba Pro2 development board to capture a JPEG image and send the image to a browser using HTTP. The following examples shows different use cases of capturing JPEG images. -1. HTTPDisplayJPEG - -2. HTTPDisplayJPEGContinuous - For the “HTTPDisplayJPEG” example, use any browser and key in the IP address of the board in browser’s address bar after the board is connected to the WiFi to view the image. -For the “HTTPDisplayJPEGContinuous” example, use the Firefox browser and key in the IP address of the board in browser’s address bar after the board is connected to the WiFi to view the image. - -Open one of the CaptureJPEG examples in “File” -> “Examples” -> “AmebaMultimedia” -> “CaptureJPEG” -> “HTTPDisplayJPEG”. +Open the example in “File” -> “Examples” -> “AmebaMultimedia” -> “CaptureJPEG” -> “HTTPDisplayJPEG”. |image01| @@ -40,20 +34,20 @@ Next, using a computer or a cell phone in the same network domain, open a browse |image04| -You can view the JPEG image that was captured by the camera on the webpage. To view a new JPEG image taken by the camera, simply refresh the page. By running “HTTPDisplayJPEGContinuous”, image will be taken repeatedly, and the image will be sent to the browser using HTTP, creating the effect of a video. Note that for the “HTTPDisplayJPEGContinuous” example, Firefox browser has been tested to work best. +You can view the JPEG image that was captured by the camera on the webpage. To view a new JPEG image taken by the camera, simply refresh the page. -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image01.png :width: 756 px :height: 832 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image02.png :width: 756 px :height: 832 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image03.png :width: 642 px :height: 393 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_display_over_HTTP/image04.png :width: 675 px :height: 323 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG save to SD Card.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG save to SD Card.rst similarity index 59% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG save to SD Card.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG save to SD Card.rst index d48bfde..1dd966a 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Capture JPEG save to SD Card.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/Capture JPEG save to SD Card.rst @@ -17,12 +17,7 @@ In this example, we will be using Ameba Pro2 development board to capture a JPEG The following examples shows different use cases for saving JPEG image to SD card. 1. SDCardSaveJPEG - -2. SDCardSaveJPEGTimelapse - -3. SDCardSaveJPEGWithNTPClient - -4. SDCardSaveJPEGTimelapseWithNTPClient +2. SDCardSaveJPEGWithNTPClient Open one of the CaptureJPEG examples in “File” -> “Examples” -> “AmebaMultimedia” -> ”CaptureJPEG” -> “SDCardSaveJPEG”. @@ -30,14 +25,12 @@ Open one of the CaptureJPEG examples in “File” -> “Examples” -> “Ameba Compile the code and upload it to Ameba. After pressing the Reset button, the Ameba Pro 2 board will start taking snapshot and save to SD card. -The SDCardSaveJPEG example will take a single snapshot every reset and save it on the SD card with the filename “image.jpg”. +The **SDCardSaveJPEG** example will take a single snapshot every reset and save it on the SD card with the filename “image.jpg”. -The SDCardSaveJPEGTimelapse example will take a snapshot every second and save them on the SD card with the filename ”imageX.jpg”, where X is a number incrementing with each image. +The **SDCardSaveJPEGWithNTPClient** example is incorporated with NTPClient to be able to set the last modified time after images are saved to the SD Card. Disconnect power from the Ameba Pro 2 board, remove the SD card and connect it to a computer to view the contents. Depending on which example code was uploaded, there will be either a single image or multiple images saved on the SD card. -The SDCardSaveJPEGWithNTPClient and SDCardSaveJPEGTimelapseWithNTPClient examples are incorporated with NTPClient to be able to set the last modified time after images are saved to the SD Card. - -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_save_to_SD_Card/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Capture_JPEG_save_to_SD_Card/image01.png :width: 768 px :height: 832 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/index.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/index.rst new file mode 100644 index 0000000..b1da7e1 --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/CaptureJPEG/index.rst @@ -0,0 +1,10 @@ +CaptureJPEG +=========== + +.. toctree:: + :maxdepth: 1 + + Capture JPEG display over HTTP + Capture JPEG display over HTTP Continuous + Capture JPEG save to SD Card + Capture JPEG Timelapse save to SD Card diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Google Line Notify.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Google Line Notify.rst similarity index 81% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Google Line Notify.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Google Line Notify.rst index 65fd693..60a700b 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Google Line Notify.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Google Line Notify.rst @@ -123,58 +123,58 @@ Code Reference 2. https://github.com/fustyles/Arduino/tree/master/ESP32-CAM_GoogleDrive_Linenotify -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image01.png :width: 850 px :height: 434 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image02.png :width: 1114 px :height: 390 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image03.png :width: 1114 px :height: 390 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image04.png :width: 528 px :height: 373 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image05.png :width: 925 px :height: 915 px -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image06.png +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image06.png :width: 550 px :height: 721 px -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image07.png +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image07.png :width: 848 px :height: 693 px -.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image08.png +.. |image08| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image08.png :width: 898 px :height: 1050 px -.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image09.png +.. |image09| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image09.png :width: 898 px :height: 1050 px -.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image10.png +.. |image10| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image10.png :width: 528 px :height: 589 px -.. |image11| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image11.png +.. |image11| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image11.png :width: 744 px :height: 473 px -.. |image12| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image12.png +.. |image12| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image12.png :width: 712 px :height: 772 px -.. |image13| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image13.png +.. |image13| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image13.png :width: 957 px :height: 544 px -.. |image14| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image14.png +.. |image14| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Google_Line_Notify/image14.png :width: 966 px :height: 513 px diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Masking with MP4 Recording.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Masking with MP4 Recording.rst similarity index 71% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Masking with MP4 Recording.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Masking with MP4 Recording.rst index 147e7dd..c9d0737 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection Masking with MP4 Recording.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection Masking with MP4 Recording.rst @@ -59,42 +59,42 @@ On top of that, when there’s motion detected, the green LED will light up and |image10| -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image01.png :width: 782 px :height: 549 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image02.png :width: 889 px :height: 984 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image03.png :width: 889 px :height: 984 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image04.png :width: 755 px :height: 800 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image05.png :width: 755 px :height: 800 px -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image06.png +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image06.png :width: 432 px :height: 482 px -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image07.png +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image07.png :width: 633 px :height: 594 px -.. |image08| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image08.png +.. |image08| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image08.png :width: 954 px :height: 639 px -.. |image09| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image09.png +.. |image09| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image09.png :width: 1000 px :height: 700 px -.. |image10| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image10.png +.. |image10| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_Masking_with_MP4_Recording/image10.png :width: 1085 px :height: 725 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Callback.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Callback.rst new file mode 100644 index 0000000..2db6222 --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Callback.rst @@ -0,0 +1,79 @@ +Motion Detection with On-Screen Display in Callback +=================================================== + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 + +Example +------- +In this example, we will be using Ameba Pro2 development board to detect motion and highlight it on a RTSP video stream. Motion Detection is achieved by comparing the RGB information of each image frame captured from the on-board camera sensor (JX-F37P). + +The following example shows how Motion Detection and the On-Screen Display is used, where the Motion Detection results are processed using a callback function. + +Open one of the Motion Detection examples in “File” -> “Example” -> “AmebaMultimedia” -> “MotionDetection” -> “CallbackPostProcessing”. + +|image01| + +In the highlighted code snippet, fill in the “ssid” with your WiFi network SSID and “pass” with the network password. + +|image02| + +Compile the code and upload it to Ameba. After pressing the Reset button, wait for the Ameba Pro 2 board to connect to the WiFi network. The board’s IP address and network port number for RTSP will be shown in the Serial Monitor. + +|image03| + +You may download VLC media player from the link (`here `_). + +Upon the completion of the software installation, open VLC media player, and go to “Media” -> “Open Network Stream”. + +|image04| + +Make sure your PC is connected to the same network as the Ameba Pro2 board for streaming. Since RTSP is used as the streaming protocol, key in `“rtsp://{IPaddress}:{port}”` as the Network URL in VLC media player, replacing {IPaddress} with the IP address of your Ameba Pro2 board, and {port} with the RTSP port shown in Serial Monitor `(e.g., “rtsp://192.168.1.174:554”)`. The default RTSP port number is 554. + +You may choose to change the caching time in “Show more options”. The default value of 1000 will introduce a one second delay between what the camera sees and what is displayed on screen. A lower cache time will result in reduced video latency but may introduce playback stuttering in the case of poor network conditions. + +|image05| + +Next, click “Play” to start RTSP streaming. The video stream from the camera will be shown in VLC media player. Multiple green boxes will be generated to identify the regions that are in motion. + +|image06| + +Code Reference +-------------- +You may adjust the video bitrate based on your WiFi network quality, by uncommenting the highlighted code below. + +|image07| + +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image01.png + :width: 960 px + :height: 1040 px + +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image02.png + :width: 746 px + :height: 832 px + +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image03.png + :width: 642 px + :height: 393 px + +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image04.png + :width: 432 px + :height: 482 px + +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image05.png + :width: 530 px + :height: 520 px + +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image06.png + :width: 1256 px + :height: 894 px + +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image07.png + :width: 750 px + :height: 822 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection with On-Screen Display.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Loop.rst similarity index 65% rename from source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection with On-Screen Display.rst rename to source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Loop.rst index 5e2616d..52b9220 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection with On-Screen Display.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/Motion Detection with On-Screen Display in Loop.rst @@ -1,5 +1,5 @@ -Motion Detection with On-Screen Display -======================================= +Motion Detection with On-Screen Display in Loop +=============================================== .. contents:: :local: @@ -14,10 +14,7 @@ Example ------- In this example, we will be using Ameba Pro2 development board to detect motion and highlight it on a RTSP video stream. Motion Detection is achieved by comparing the RGB information of each image frame captured from the on-board camera sensor (JX-F37P). -The following examples shows how Motion Detection and the On-Screen Display is used. The main difference between the two examples is where the Motion Detection results are processed. “CallbackPostProcessing” uses a callback function, while “LoopPostProcessing” deals with the results in the loop function. - -1. LoopPostProcessing -2. CallbackPostProcessing +The following example shows how Motion Detection and the On-Screen Display is used, where the Motion Detection results are processed in the loop function. Open one of the Motion Detection examples in “File” -> “Example” -> “AmebaMultimedia” -> “MotionDetection” -> “LoopPostProcessing”. @@ -53,30 +50,30 @@ You may adjust the video bitrate based on your WiFi network quality, by uncommen |image07| -.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image01.png +.. |image01| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image01.png :width: 960 px :height: 1040 px -.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image02.png +.. |image02| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image02.png :width: 746 px :height: 832 px -.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image03.png +.. |image03| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image03.png :width: 642 px :height: 393 px -.. |image04| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image04.png +.. |image04| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image04.png :width: 432 px :height: 482 px -.. |image05| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image05.png +.. |image05| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image05.png :width: 530 px :height: 520 px -.. |image06| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image06.png +.. |image06| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image06.png :width: 1256 px :height: 894 px -.. |image07| image:: ../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image07.png +.. |image07| image:: ../../../../../_static/amebapro2/Example_Guides/Multimedia/Motion_Detection_with_On-Screen_Display/image07.png :width: 750 px :height: 822 px \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/index.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/index.rst new file mode 100644 index 0000000..93b8126 --- /dev/null +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/Motion Detection/index.rst @@ -0,0 +1,10 @@ +Motion Detection +================ + +.. toctree:: + :maxdepth: 1 + + Motion Detection Google Line Notify + Motion Detection Masking with MP4 Recording + Motion Detection with On-Screen Display in Loop + Motion Detection with On-Screen Display in Callback \ No newline at end of file diff --git a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/index.rst b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/index.rst index 188ab6f..13c0b36 100644 --- a/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/index.rst +++ b/source/ameba_pro2/amb82-mini/Example_Guides/Multimedia/index.rst @@ -2,21 +2,14 @@ Multimedia ========== .. toctree:: - :maxdepth: 1 + :maxdepth: 2 - Audio Basic - Audio Effects - Capture JPEG display over HTTP - Capture JPEG save to SD Card - Echo Cancellation + Audio/index + CaptureJPEG/index ISP Control - Motion Detection Google Line Notify - Motion Detection Masking with MP4 Recording - Motion Detection with On-Screen Display + Motion Detection/index MP4 Recording Play MP3 with SD card - RTP Audio Stream - RTSP Audio Stream RTSP Demuxer RTSP Streaming V7RC RTSP Streaming