esp-kos-bridge with wss + async

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 10:35 am

hola all.
got problems with sending async data trough websocket.
program can be found here:
https://github.com/m5it/esp-kos-bridge/tree/v0.4b1

problem is that after 1min or so send fail.

example output is here:
[0;32mI (233143) T3CH_HTTPD: trigger_async_task() STARTING id/hash: cbea68d7, action: ping, uid: PING
[0m
[0;32mI (233156) T3CH_HTTPD: trigger_async_task() DEBUG id: cbea68d7, wuai: 0
[0m
async_task() STARTING id: cbea68d7, action: ping, uid: PING
async_task() new task_id: 84
async_task() DONE action: ping, uid: PING
ws_task_ping() STARTING with task_id: 84
ws_task_infoLoop() running, tmphd: 1073588904, tmpfd: 58
ws_task_ping() D2 hash: cbea68d7, uid: PING, action: ping
ws_task_ping() DEBUG wuai: 0
t3ch_ws_async_send() STARTING, fd: 58
t3ch_ws_async_send() STARTING, fd: 58
[0;31mE (233201) esp-tls-mbedtls: write error :-0x6C00:[0m
[0;33mW (233203) httpd_ws: httpd_ws_send_frame_async: Failed to send WS header[0m
[0;31mE (233216) T3CH_HTTPD: t3ch_ws_async_send() failed with ffffffff[0m
ws_task_ping() send failed err: ffffffff, cnt: 0/5.
ws_task_ping() DEBUG wuai: 0
t3ch_ws_async_send() STARTING, fd: 58

if you have any tip i will be glad ! thanks*

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 10:37 am

and 102 mean invalid argument. so handle looks correct, fd/sockets looks correct... so what happen.. :x

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 12:05 pm

think the fix is that when server send something to client, client should respond and you should save handle and sockets. specialy handle. and then looks like works.!

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 12:11 pm


w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 12:12 pm

people.! love you all and like that we can function together!!! like this we will be faster etc... :)
thanks! *

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 2:52 pm

this is solved! but you guys are not worth of nothiing! that dont speak of. not remember what but.. you know probably.*** b*t*h*s

well sorry. didnt mean so hard. just when i get into my problems sometimes i say stupid things! really sory. anyway. next post i like we do more than we can... please. get together! :)
Last edited by w4d4f4k on Sat Feb 11, 2023 4:38 pm, edited 2 times in total.

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sat Feb 11, 2023 4:34 pm

now just to get your attencion.. so i dont know good but i like we make a team! a group or something like that to work together, make projects together and we can meat each other.
if anyone is interesting please pm or write here.! thanks!

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sun Feb 12, 2023 2:07 pm

first. i want to appologise to all for yesterday because sometimes i write what should not. sorry!
second. it is not important to overwrite handle or socket on response well i am still not sure why comes to error.. :x possible is connected with bad allocation of memory.

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Sun Feb 12, 2023 2:54 pm

here i see program send 2 messages at same time looks this is some kind of problem because when this happen then we get error.
t3ch_ws_async_send() STARTING, hd: 1073588500, fd: 58, datalen: 190
t3ch_ws_async_send() STARTING, hd: 1073588500, fd: 58, datalen: 102

maybe we should use kind of push / pop functionality for things that should be sent.
no think got an idea. because we use array of structure for saving clients and there we can define if any data is beeing sent in this moment or not. if yes then we wait this is done and then sent... will try i think this will work

for now have fixed by removing some test code and adding select before async send and looks works. now new problem is add to log because of async send and thredings.. so here we will need somekind push/pop idea to fix this i gues..

last update is here
https://github.com/m5it/esp-kos-bridge

w4d4f4k
Posts: 27
Joined: Fri Dec 02, 2022 10:41 pm

Re: esp-kos-bridge with wss + async

Postby w4d4f4k » Wed Feb 15, 2023 1:39 pm

select() have replaced for semaphores !

Who is online

Users browsing this forum: No registered users and 58 guests