Closed c6fc closed 1 year ago
@c6fc Could you share the source code you tested? I want to reproduce the same issue on my setup.
Sure thing. These are both after a lot of iterations during testing, so they're super ugly, but it should be reproducible for you:
https://gist.github.com/c6fc/49d27fb60b8313029d756e497a6b7bfd https://gist.github.com/c6fc/dd95af62477d184a96863d496603e469
@c6fc Thank you for your information. I found some issues on the current FW. One of the issue is that tcp server is not reset at soft reset. So we need to have hard reset to run a tcp server. I fix this issue and upload new code in the pico-w branch. please test with this FW and let me know your test result. https://github.com/kaluma-project/kaluma/tree/pico-w
if I use the uf2 I built with node build --target=rp2 --board=pico-w
on the current pico-w
branch, I get the following error on upload.
If I switch back to the public release pico-w-1.1.0-beta.1 UF2, I don't get this error. Are there additional arguments required for the pico-w build to get the drivers passed into it?
@c6fc It's strange. there's no changes related to the wifi driver. Could you please try it with .reset command before .load command?
And please use attached uf2 file which I used for this test.
@communix I just gave this latest uf2 a try. net.createServer
seems to work correctly once. I can do a res.write to send a string back to the client (netcat in this case). After that one connection I have to hard reset to make another connection. Unfortunately http.createServer
is hanging when I call it.
For both I'm just using the example code from the docs.
Appreciate your work on this!!
I have the same issue.
Tried it both with the current FW and kaluma-rp2-pico-w-1.1.0-beta.1_pico_w_test_0118.uf2.zip Same result on both, only works once. Here's my code: https://gist.github.com/emerson-a/d48df41f8431ebcb3ed516f17485d7ef
I also appreciate your work on this!
@etx @emerson-a Thank you for your feedback. let me check it.
@emerson-a @etx Could you please try it with this binary? http.create server is working with this code. But I can't reproduce the hard reset issue, (After that one connection I have to hard reset to make another connection.) If you still have the same issue, please create new issue with the detailed scenario.
I got the same issue than @emerson-a and @etx .
After one connection, I can't make another connection.
I try to debug it but I am really struggling. It seems to have a link with the code using the listen fd to manage the connection with the client.
static err_t __tcp_server_accept_cb(void *arg, struct tcp_pcb *newpcb,
err_t err) {
if (err == ERR_OK) {
// test create fd
uint8_t *oldFd = (uint8_t *)arg;
int fdV = km_get_socket_fd();
uint8_t *fd = &fdV;
memcpy(&__socket_info.socket[*fd], &__socket_info.socket[*oldFd], sizeof(__socket_data_t));
__socket_info.socket[*fd].fd = fdV;
(Sorry for the really bad code!)
I am able to connect again with another client but i can't connect two client in parallel.
@emerson-a @etx Could you please try it with this binary? http.create server is working with this code. But I can't reproduce the hard reset issue, (After that one connection I have to hard reset to make another connection.) If you still have the same issue, please create new issue with the detailed scenario.
I have tested this but the same issue occurs. I can only make one http connection.
Thanks again for your work on this!
@emeson-a, @K4ST0R Thank you for your feedback. I think the remaining issue issue is two client support. I have created new issue about is (#557), So let's discuss this issue at #557. I'll close this issue. If anyone find new issue or the issue which is not fixed now, please create new issue. I'll take a look this issue.
@communix Could you post the JS file you're flashing to test http.createServer? I'm still having a hard time getting it to work. Thank you!
@etx I'm testing with the @emerson-a 's code. https://gist.github.com/emerson-a/d48df41f8431ebcb3ed516f17485d7ef
Using the kaluma-rp2-pico-w-1.1.0-beta.1.uf2 release, the 'createServer' method for 'net' and 'http' modules shows incorrect details for connected sockets:
In both cases, calls to '.write()' methods fail to deliver the data back to the client, but no errors are returned and the callbacks for both '.write()' and '.end()' execute normally. I haven't been able to verify what the outbound packet from the pico-w look like (so I don't know if injecting the correct raddr and rport will cause the data to be delivered), but at the moment it seems that the incorrect socket details are preventing server responses from reaching the client.