Problem with OTA example

fmuller-pi

Problem with OTA example

Postby fmuller-pi » Fri Feb 22, 2019 2:29 am

Hi,

I am trying to implement an OTA in my application and I am using the ESP8266_RTOS_SDK_v3.1 example. I am using the "Factory app, two OTA definitions" partition table. When I run the example, it connects to the local Python HTTP server, and then it calls

Code: Select all

esp_ota_begin(...)
, and within this function, it fails when it comes to deleting the flash partition, even though it announces the right partition in memory that it is going to delete (0x110000). What happens is that it starts deleting and then the microcontroller freezes and all of a sudden I receive lots of random characters through UART and when I reboot the chip it says that there is no firmware on none of my partitions...
Please, anyone knows what I am doing wrong and how I could try to fix this?

Thanks a lot!

fmuller-pi

Re: Problem with OTA example

Postby fmuller-pi » Fri Feb 22, 2019 4:57 am

Please help...

I'm running straight the example from the SDK (even just moved to the master branch and did fetch to make sure I am as up to date as possible)...

This is what I get on my monitor console:

Code: Select all

.[0;32mI (735) ota: Starting OTA example... @ 0x402398a4 flash 1MB.[0m
.[0;31mE (735) esp_ota_ops: ota data invalid, no current app. Assuming factory.[0m
.[0;32mI (745) ota: Running partition type 0 subtype 16 (offset 0x00006000).[0m
.[0;32mI (10295) event: sta ip: 192.168.128.55, mask: 255.255.255.0, gw: 192.168.128.1.[0m
.[0;32mI (10295) ota: Connect to Wifi ! Start to Connect to Server.....[0m
.[0;32mI (10305) ota: Server IP: 192.168.128.79 Server Port:8070.[0m
.[0;32mI (10455) ota: Connected to server.[0m
.[0;32mI (10455) ota: Connected to http server.[0m
.[0;32mI (10465) ota: Send GET request to server succeeded.[0m
.[0;32mI (10465) ota: Writing to partition subtype 17 at offset 0x86000.[0m


The I get the next line right away:

Code: Select all

dev 1371


And then, a few seconds later, I get a bunch of random characters like these:

Code: Select all

"@™rjrA(!ãSÀuã–öˆõX%.˘´–y ah)."8·t.Ì…™N¯äÚ÷$|HË


And if I reboot I get:

Code: Select all

ets Jan  8 2013,rst cause:1, boot mode:(3,6)

ets_main.c


This is the example in the folder examples/system/ota from the ESP_RTOS_SDK, with no modifications except my ssid, password, and http server ip.

I am really running out of idea on what could the issue be. Anyone ever ran in that type of issue or know what I could try to resolve it?

AgentSmithers
Posts: 195
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: Problem with OTA example

Postby AgentSmithers » Sat Feb 23, 2019 2:41 am

Hi FMuller, Sadly I'm a NONOS SDK guy so I don't have any insight on this one. But if things don't get moving for you or you don't resolve it in a week, I'll come check back here and we can do a remote session to get another set of eyes on it for you.
-Agent

fmuller-pi

Re: Problem with OTA example

Postby fmuller-pi » Sat Feb 23, 2019 3:25 am

Thanks for your reply AgentSmithers!
I was actually just able to figure out what was going on. Turned out that the OTA example provided by ESP works just fine. The issue was coming from the fact that the flash we were using wasn't 4MBytes but 4Mbits... The chip had been selected before I started working on this project and I was told it was a 4MBytes, but I guess I should have double checked sooner...
In any case, now I have replaced it with a 2MBytes and it is working just fine with the example!

Thanks!

AgentSmithers
Posts: 195
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: Problem with OTA example

Postby AgentSmithers » Sat Feb 23, 2019 5:48 am

fmuller-pi wrote:Thanks for your reply AgentSmithers!
I was actually just able to figure out what was going on. Turned out that the OTA example provided by ESP works just fine. The issue was coming from the fact that the flash we were using wasn't 4MBytes but 4Mbits... The chip had been selected before I started working on this project and I was told it was a 4MBytes, but I guess I should have double checked sooner...
In any case, now I have replaced it with a 2MBytes and it is working just fine with the example!

Thanks!


Thank you for the feedback, Just as an additional thing to watch for. Different manufacturers of the same product like Wemos will physically use different SPI chips on boards that look IDENTICAL! So during this whole finding both seem to work in DIO mode but NOT QIO mode, Only one of the chips supported QIO so as a standard I use DIO. Nice job!

Who is online

Users browsing this forum: No registered users and 278 guests