microsoft / devicescript

TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
https://microsoft.github.io/devicescript/
MIT License
3.23k stars 111 forks source link

"error can't alloc pcb" occurs when calling fetch API. #664

Open pelikhan opened 7 months ago

pelikhan commented 7 months ago

Discussed in https://github.com/microsoft/devicescript/discussions/660

Originally posted by **yuichisuzuki0601** November 8, 2023 * The device is Raspberry Pi pico. * I have confirmed that the device is connected to wifi. * It happens when I make an http request. * Timeout occurs when making https request. # error log ``` DEV> connecting to tcp://192.168.0.8:8080 DEV> socket tcp://192.168.0.8:8080 error can't alloc pcb DEV> Unhandled exception DEV> Exception: Error DEV> message: socket tcp://192.168.0.8:8080: can't alloc pcb DEV> at _connect [as F38_pc214] (node_modules/@devicescript/net/src/sockets.ts:158:29) DEV> at connect [as F20_pc7] (node_modules/@devicescript/net/src/sockets.ts:172:5) DEV> at fetch [as F15_pc534] (node_modules/@devicescript/net/src/fetch.ts:174:5) DEV> at inline [as F8_pc23] (src/main.ts:47:5) DEV> at emit [as F64_pc24] (node_modules/@devicescript/core/src/events.ts:23:17) DEV> Unhandled exception DEV> stop program DEV> connection error: "sock write error" DEV> connection error: "sock write error" DEV> connection error: "sock write error" DEV> connection error: "sock write error" DEV> connection error: "sock write error" ``` I want to know the cause and solution.
PiotrKasperski commented 7 months ago

i've got similaar problem. When i'm trying to connect my local hivemq server i'm getting:

DEV> mqtt: socket connecting to 192.168.1.152:1883
DEV> connecting to tcp://192.168.1.152:1883
DEV> socket tcp://192.168.1.152:1883 error can't alloc pcb
DEV> mqtt: disconnect

Connection to tcp://broker.hivemq.com work fine, also i'm sure my server work's good.