Hi,
with a custom hardware, I'm using a NRF9160 with a ESP8266 chip over uart with following prj.conf and board overlay:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_TX_STACK_SIZE=2048
CONFIG_NET_RX_STACK_SIZE=2048
CONFIG_NET_IF_MAX_IPV4_COUNT=2
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=n
CONFIG_NET_UDP=n
CONFIG_NET_TCP=y
CONFIG_NET_LOG=y
CONFIG_NET_SHELL=y
CONFIG_TEST_RANDOM_GENERATOR=y
# WIFI
CONFIG_WIFI=y
CONFIG_WIFI_ESP_AT=y
CONFIG_WIFI_OFFLOAD=y
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
&uart1 {
status = "ok";
current-speed = <115200>;
tx-pin = <23>;
rx-pin = <22>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
/* disable by setting them to 0xffffffff */
esp8266 {
status = "ok";
compatible = "espressif,esp-at";
label = "esp8266";
};
};
I was trying to open a socket (that uses the Wifi chip) and connect to it:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int sock = 0;
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0) {
printk("Failed to create socket %d\n", errno);
return -1;
}
ret = connect(sock, (struct sockaddr *) &addr, addr_len);
if (ret < 0) {
printk("Cannot connect to %s remote (%d)",
family == AF_INET ? "IPv4" : "IPv6",
-errno);
ret = -errno;
}
I tried to debug it, and I noticed that the wrong network interface is chosen, with the consequence that the offload functions are not called. I guess that it's a configuration issue, but until now no luck to find it...