Comments (8)
There is actually stuff in the esp32-related plugins where the device itself will go out in client mode and look for newer firmware from a remote server. I checked this basically worked when I wrote it, but I haven't tested it in a while.
https://github.com/warmcat/libwebsockets/blob/master/plugins/protocol_esp32_lws_scan.c#L216
https://github.com/warmcat/libwebsockets/blob/master/plugins/protocol_esp32_lws_scan.c#L1136
If you define these things
Var | example |
---|---|
CONFIG_LWS_MODEL_NAME | "bfg9000" |
CONFIG_LWS_OTA_SERVER_BASE_URL | "/url-base-on-server", eg, "/updates" |
CONFIG_LWS_OTA_SERVER_FQDN | "myserver.com" |
It will check for, eg
https://myserver.com/updates/bfg9000/manifest.json
This is the same file generated during build in ./build. If it wants it, it will download .../bfg9000/projectname.bin, again from ./build.
at startup when it gets internet in factory mode. It gets projectname.bin from the existing firmware's manifest.
from lws-esp32-factory.
do you think i can convert these HTTP POST Requests:
LWS_CALLBACK_HTTP_BODY
LWS_CALLBACK_HTTP_BODY_COMPLETION
to WebSocket requests and change POST Request parsing to websocket parsing.
This can be the way?
Downloading a file is good but think about the opportunity that a factory can send userapp to another factory via websocket. This sound very interessting and i can just use my server with websocketd to send userapp.bin
would you prefer that i should use libwebsocket with c++ in ubuntu server to transmit userapp or ready-to-use websocketd application?
I would appreciate if you give hints about my concept because i think this kind of a concept has a good future.
thanks
from lws-esp32-factory.
i found out, that you handle http and ws protocoll in same routine?? That makes the things easier,
Is there a format that i can start ws.send(....) and the data goes into esp_ota_begin, ota_write and ota_end??
from lws-esp32-factory.
You can have it also support wss, but overall, isn't it easier to do it with https, and copy the files somewhere that any http server can serve them? Ws doesn't really buy you anything afaik.
from lws-esp32-factory.
how do you download a file?
And if you download, than you have to read and call esp_ota_begin , write, end anyway. But i am also OK with this solution, just think that it is the same complicity.
Can you give me a hint or i will try to route ws data to esp_ota_begin etc...
from lws-esp32-factory.
https://github.com/warmcat/libwebsockets/blob/master/plugins/protocol_esp32_lws_scan.c#L216
https://github.com/warmcat/libwebsockets/blob/master/plugins/protocol_esp32_lws_scan.c#L1136
from lws-esp32-factory.
ok, i've solved. It is the best practice to change server data from sdkconfig
from lws-esp32-factory.
It does let you control it from sdkconfig
CONFIG_LWS_OTA_SERVER_FQDN="libwebsockets.org"
CONFIG_LWS_OTA_SERVER_BASE_URL="/esp32-ota"
CONFIG_LWS_OTA_SERVER_UPLOAD_USER="root"
CONFIG_LWS_OTA_SERVER_UPLOAD_PATH="/var/www/libwebsockets.org"
Btw there is a make target make upload
that lets you scp the current project binary to the remote server along with the manifest, using the SERVER_UPLOAD_USER / _PATH vars.
from lws-esp32-factory.
Related Issues (20)
- lws-esp32-factory/components/bootloader/Makefile.projbuild:37: *** multiple target patterns. Stop. HOT 3
- oto_choose_part will accept partition outside range HOT 2
- INFO: ota update of factory partition fails HOT 8
- lws-esp32-factory is always listed as dirty HOT 4
- Does it link on ESP32 HOT 2
- Connection terminates after approximetly 10 minutes HOT 3
- Minor: Missing "hard" for Git command in Readme HOT 1
- Lets Encrypt stops at first step
- tcp_connect: can only connect from state CLOSED
- Partition table too small for newer esp-idf HOT 4
- how to force enter app after first reboot HOT 7
- Updated alignment with esp-idf/mbedtls needed to build with latest esp-idf HOT 16
- websocket client example
- Error during make flash monitor HOT 2
- mbedtls_handshake: ssl ret -6900 state 8
- arduino-esp32 support ?
- multiple definition of api functions when using openssl api functions HOT 1
- build fail for lws-esp32-factory HOT 12
- Can this be used on esp8266 HOT 1
- Please give me an esp8266 program about LWS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lws-esp32-factory.