OTA Example not working
Posted: Fri Feb 10, 2017 6:38 pm
I've tried to get the OTA example working found in the esp-idf. I tried following the steps given, but it resulted in lots of errors.
A few examples of those errors.
esp-idf/examples/system/ota/build/esp32/libesp32.a(system_api.o):(.iram1.literal+0x34): undefined reference to `esp_wifi_stop'
/esp32/esp-idf/components/esp32/lib/librtc.a(bt_bb.o): In function `bt_rfoffset_en':
(.text+0x450): undefined reference to `g_phyFuns'
/esp32/esp-idf/components/esp32/lib/librtc.a(bt_bb.o): In function `force_bt_mode':
(.text+0x7c8): undefined reference to `phy_force_wifi_chan'
I then copied the code into Eclipse where I am doing the rest of my project. I had a lot of errors here too, so I did the following replacements:
bool -> int
true -> 1
false -> 0
<netdb.h> -> "lwip/netdb.h"
<sys/socket.h> -> "lwip/sockets.h" AND "lwip/sys.h"
I also updated the example wifi settings to match that of my router. The following is the output of the esp32.
The output of the python script
Ultimately I want the code in eclipse, make the binary, and then signal the esp32 to connect the the server, download the binary, and then use the new image. It looks to me like if this example works, I can use this code in my project, and I would just need to signal the OTA to start, and everything would basically work as planned.
A few examples of those errors.
esp-idf/examples/system/ota/build/esp32/libesp32.a(system_api.o):(.iram1.literal+0x34): undefined reference to `esp_wifi_stop'
/esp32/esp-idf/components/esp32/lib/librtc.a(bt_bb.o): In function `bt_rfoffset_en':
(.text+0x450): undefined reference to `g_phyFuns'
/esp32/esp-idf/components/esp32/lib/librtc.a(bt_bb.o): In function `force_bt_mode':
(.text+0x7c8): undefined reference to `phy_force_wifi_chan'
I then copied the code into Eclipse where I am doing the rest of my project. I had a lot of errors here too, so I did the following replacements:
bool -> int
true -> 1
false -> 0
<netdb.h> -> "lwip/netdb.h"
<sys/socket.h> -> "lwip/sockets.h" AND "lwip/sys.h"
I also updated the example wifi settings to match that of my router. The following is the output of the esp32.
Code: Select all
[0;32mI (5789) event: ip: 192.168.135.12, mask: 255.255.0.0, gw: 192.168.135.1[0m
[0;32mI (5790) ota: Connect to Wifi ! Start to Connect to Server....[0m
[0;32mI (5792) ota: Server IP: 192.168.135.6 Server Port:8071[0m
[0;32mI (6025) ota: Connected to server[0m
[0;32mI (6025) ota: Connected to http server[0m
[0;32mI (6026) ota: Send GET request to server succeeded[0m
[0;31mE (6028) esp_ota_ops: not found ota data[0m
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Code: Select all
Serving HTTP on 0.0.0.0 port 8071 ...
192.168.135.12 - - [10/Feb/2017 11:32:57] "GET /hello-world.bin HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.135.12', 9756)
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 654, in __init__
self.finish()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 713, in finish
self.wfile.close()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 283, in close
self.flush()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 307, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe