Skip to content

Update Ameba Documents #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,28 @@ Click “CONNECT”. The “hello world” message show up at left side. At righ

|image13|

**MQTT_NonBlocking example**

Open the MQTT example: “File” → “Examples” → “AmebaMQTTClient” → “MQTT_NonBlocking”.

This example demonstrates how to maintain a connection to the MQTT broker using a **non-blocking** reconnect approach. If the connection is lost, the board will attempt to reconnect **every 5 seconds**, without halting the rest of the loop operations.

Please modify some WiFi-related parameter and some information related to MQTT:

|image14|

- 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.

.. note :: This example uses a **non-blocking reconnect** mechanism. That means the board does not freeze while waiting to reconnect. You can continue performing other tasks inside `loop()` even during disconnection periods.

.. |image01| image:: ../../../../_static/amebad/Example_Guides/MQTT/MQTT_Set_Up_MQTT_Client_To_Communicate_With_Broker/image01.png
:width: 940
:height: 619
Expand Down Expand Up @@ -186,3 +208,7 @@ Click “CONNECT”. The “hello world” message show up at left side. At righ
.. |image13| image:: ../../../../_static/amebad/Example_Guides/MQTT/MQTT_Set_Up_MQTT_Client_To_Communicate_With_Broker/image13.png
:width: 650
:height: 199
.. |image14| image:: ../../../../_static/amebad/Example_Guides/MQTT/MQTT_Set_Up_MQTT_Client_To_Communicate_With_Broker/image14.png
:width: 1070
:height: 1217
:scale: 80%
57 changes: 57 additions & 0 deletions source/_common/ameba_d/Example_Guides/SYS/SYS - MemInfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
SYS - MemInfo
=============

.. contents::
:local:
:depth: 2

Materials
---------

- AmebaD [AMB21 / AMB22 / AMB23 / AMB25 / AMB26 / BW16 / AW-CU488 Thing Plus] x 1


**Introduction**
~~~~~~~~~~~~~~~~

This example demonstrates how to monitor the current OS free heap size on the Ameba board using FreeRTOS.

FreeRTOS uses a memory heap for dynamic memory allocation and creating threads. Monitoring the heap size is important because a low heap size can lead to allocation failures and abnormal behavior.

**Procedure**
~~~~~~~~~~~~~

Step 1. Open Example

Open the example: ``“Files” → “Examples” → “AmebaSys” → “MemInfo”``

|image01|

Step 2. Upload Code

Upload the code and open the Serial Monitor.

The output will show the available heap size before and after memory allocation and freeing:

- Initial free heap size
- Free heap size after allocating 1000 bytes
- Free heap size after freeing the memory

This helps you understand how dynamic memory usage affects available heap space at runtime.

|image02|

.. note :: If the available heap size becomes too low, and memory is allocated beyond what is available, the allocation will fail.

|image03|

.. |image01| image:: ../../../../_static/amebad/Example_Guides/SYS/SYS_MemInfo/image01.png
:width: 2553
:height: 1376
:scale: 30%
.. |image02| image:: ../../../../_static/amebad/Example_Guides/SYS/SYS_MemInfo/image02.png
:width: 606
:height: 254
.. |image03| image:: ../../../../_static/amebad/Example_Guides/SYS/SYS_MemInfo/image03.png
:width: 809
:height: 167
7 changes: 7 additions & 0 deletions source/_common/ameba_d/Example_Guides/SYS/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SYS
===

.. toctree::
:maxdepth: 1

SYS - MemInfo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/ameba_d/amb21/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
USB/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/amb23/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
USB/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/amb25/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
WDT/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/amb26/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
WDT/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/aw-cu488/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
WDT/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/bw16-typeb/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
WDT/index
Expand Down
1 change: 1 addition & 0 deletions source/ameba_d/bw16-typec/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Example Guides
PWM/index
RTC/index
SPI/index
SYS/index
TensorFlow Lite/index
UART/index
WDT/index
Expand Down
1 change: 0 additions & 1 deletion source/ameba_pro2/amb82-mini/Example_Guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Example Guides

Basic/index
BLE/index
Debugging/index
E-Paper/index
File System/index
Flash Memory/index
Expand Down
21 changes: 14 additions & 7 deletions source/custom_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'amb23': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -25,7 +26,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'amb25': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -35,7 +37,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'amb26': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -45,7 +48,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'bw16-typeb': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -55,7 +59,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'aw-cu488': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -65,7 +70,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],

'bw16-typec': ['_common/ameba_d/API_Documents/Analog', '_common/ameba_d/API_Documents/AudioCodec'
, '_common/ameba_d/API_Documents/BLE', '_common/ameba_d/Example_Guides/OTA', '_common/ameba_d/API_Documents/EPDIF', '_common/ameba_d/API_Documents/FatfsSDcard', '_common/ameba_d/API_Documents/FlashMemory'
Expand All @@ -75,7 +81,8 @@
, '_common/ameba_d/API_Documents/SoftwareSerial', '_common/ameba_d/API_Documents/SPI', '_common/ameba_d/API_Documents/Sys', '_common/ameba_d/API_Documents/USB', '_common/ameba_d/API_Documents/WDT'
, '_common/ameba_d/API_Documents/Wire', '_common/ameba_d/API_Documents/WS2812B', '_common/ameba_d/Example_Guides/BLE', '_common/ameba_d/Example_Guides/Debugging', '_common/ameba_d/Example_Guides/Flash Memory'
, '_common/ameba_d/Example_Guides/GPIO', '_common/ameba_d/Example_Guides/GTimer', '_common/ameba_d/Example_Guides/I2C', '_common/ameba_d/Example_Guides/IPv6', '_common/ameba_d/Example_Guides/MDNS'
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'],
, '_common/ameba_d/Example_Guides/MQTT', '_common/ameba_d/Example_Guides/PWM', '_common/ameba_d/Example_Guides/UART', '_common/ameba_d/Example_Guides/WDT', '_common/ameba_d/Example_Guides/WS2812B'
, '_common/ameba_d/Example_Guides/SYS'],
}

def create_folder(folder_name):
Expand Down