Skip to content
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

OTA Issues in Pre Release Version 4.0.8 - 2024/10/03 #268

Closed
1 task done
TeaBear5 opened this issue Oct 3, 2024 · 2 comments
Closed
1 task done

OTA Issues in Pre Release Version 4.0.8 - 2024/10/03 #268

TeaBear5 opened this issue Oct 3, 2024 · 2 comments
Labels
pending It is a feature/bug-fix request, currently on hold

Comments

@TeaBear5
Copy link

TeaBear5 commented Oct 3, 2024

Boards

AMB82-MINI

External Hardware

USB Connection to PC

Hardware Configuration

None

Version

latest dev (checkout manually)

IDE Name

Arduino IDE 2.3.3 & arduino-cli 1.0.0-4c.1 Commit: ba19a2d3

Operating System

Ubuntu 22.04.4 LTS

Auto Flash Mode

Disable

Erase All Flash Memory (16MB)

Disable

Standard Lib

Arduino_STD_PRINTF

Upload Speed

2000000

Description

I am having issues using the ameba-OTA-UI to properly run OTA when linked to the example OTA project in the following dev release 4.0.8-build20241003.

Frist I changed the ip address in the ota_drv.c file shown below:
image

That made me able to get my device to show up in the UI as shown below:
Screenshot from 2024-10-03 14-15-06

However, i can't seem to get the OTA to trigger using the UI. to further clarify the following is the response on the device side:

[http_update_ota] Download new firmware begin, total size : 5447680

[http_update_ota] Current firmware index is 1
..
[ota_flash_NOR] target_fw_addr=0x520000, target_fw_len=0x10000

[http_update_ota] ota flash failed

On the UI side the folloing request seems to error out:
image

for further context the connectedclients request seems to be working properly:

{
    "recentEntries": [
        {
            "ip": "192.168.30.45",
            "timestamp": 1727979457117,
            "OTA_state": "OTA_STATE_DOWNLOAD_FIRMWARE_COMPLETED"
        }
    ]
}

But the start_ota request seems to have an issue in getting a proper response:
image

Any help would be appreciated. I plan to take a deeper look at the OTA drivers, but was wondering if there was something obvious i was missing before doing so.

Sketch

#include "ota_thread.h"
#include "WiFi.h"


char ssid[] = "Network_SSID";    // your network SSID (name)
char pass[] = "Password";        // your network password
int status = WL_IDLE_STATUS;

void setup()
{
    Serial.begin(115200);

    // Connection to internet
    while (status != WL_CONNECTED) {
        Serial.print("Attempting to connect to WPA SSID: ");
        Serial.println(ssid);
        status = WiFi.begin(ssid, pass);
        delay(2000);
    }

    // Set up the threads
    start_OTA_threads();
}

void loop()
{
    // Empty or add non-blocking code here
}

Error/Debug Message

See Description (No Compile or upload error).

Reproduce remarks

No response

I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

  • I confirm I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.
@TeaBear5 TeaBear5 added the pending It is a feature/bug-fix request, currently on hold label Oct 3, 2024
@kev0077
Copy link
Contributor

kev0077 commented Oct 4, 2024

hi @TeaBear5 , I think you have missed out the following steps in creating the OTA firmware image.

  1. Set NN Model Load From SD Card. “Tools” -> “NN Model Load From” -> “SD Card”
    image0446
  2. Enable the OTA mode. “Tools” -> “OTA Mode” -> “Enable”
    image

Compile the code again using Arduino IDE, you will then find the ota.bin file in the /home/username/.arduino15/packages/Realtek/tools/ameba_d_tools/x.x.x/ folder
image
This is the .bin file to be uploaded to your UI server for OTA trigger.

Thank you.

@TeaBear5
Copy link
Author

TeaBear5 commented Oct 4, 2024

@kev0077 Thanks! This works great!

For anyone else's reference this can also be accomplished using the arduino-cli tool with a command similar to the following:

arduino-cli compile --fqbn realtek:AmebaPro2:Ameba_AMB82-MINI --output-dir ./build \
--build-property build.ota_mode_val=Enable \
--build-property build.ota_mode_flags=-DArduino_OTA_MODE \
--build-property build.Arduino_LOAD_MODEL_flags=-DArduino_LOAD_MODEL_SD \
--build-property build.model_src=LoadFromSD \
OTA_Test

@TeaBear5 TeaBear5 closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending It is a feature/bug-fix request, currently on hold
Projects
None yet
Development

No branches or pull requests

2 participants