Issue with Golioth FUOTA Example on SIM7080 Modem – Stuck at DHCP

I’m working with the Golioth Firmware SDK (main) and using the FUOTA example with a SIMCOM SIM7080 modem on the 1NCE network. My device gets an IP address assigned on the 1NCE admin interface, but it seems stuck in the DHCP process when trying to establish a connection.

Configuration

Here are the relevant parts of my prj.conf:

# Golioth configuration
CONFIG_GOLIOTH_FIRMWARE_SDK=y
CONFIG_GOLIOTH_FW_UPDATE=y
CONFIG_GOLIOTH_SAMPLE_COMMON=y
CONFIG_GOLIOTH_SAMPLE_HARDCODED_CREDENTIALS=y

CONFIG_GOLIOTH_SAMPLE_PSK_ID="xxxx"
CONFIG_GOLIOTH_SAMPLE_PSK="xxxx"

CONFIG_GOLIOTH_SAMPLE_DHCP_BIND=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_DHCPV4=y

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_L2_PPP=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_CONTEXT_RCVTIMEO=y

# Modem driver
CONFIG_MODEM=y
CONFIG_MODEM_SIM7080=y
CONFIG_MODEM_SIMCOM_SIM7080_APN="iot.1nce.net"

Code Initialization

My code initializes the modem, sets up Golioth, and attempts to send data:

device_init(modem);
pm_device_action_run(modem, PM_DEVICE_ACTION_RESUME);

// Test send
net_connect();

const struct golioth_client_config *client_config = golioth_sample_credentials_get();
struct golioth_client *client = golioth_client_create(client_config);

golioth_client_register_event_callback(client, on_client_event, NULL);
golioth_fw_update_init(client, _current_version);

k_sem_take(&connected, K_FOREVER);```

Log Output
The modem initializes correctly, attaches to the network, and gets an IP on the 1NCE admin panel, but the DHCP process does not complete:
```00> [00:00:07.699,645] <inf> modem_simcom_sim7080: Manufacturer: SIMCOM_Ltd
00> [00:00:07.753,570] <inf> modem_simcom_sim7080: Model: SIMCOM_SIM7080
00> [00:00:07.808,746] <inf> modem_simcom_sim7080: Revision: 1951B16SIM7080
00> [00:00:07.862,792] <inf> modem_simcom_sim7080: IMEI: 860016049750693
00> [00:00:07.916,534] <inf> modem_simcom_sim7080: IMSI: 901405114763880
00> [00:00:07.970,825] <inf> modem_simcom_sim7080: ICCID: 89882280666147638807
00> [00:00:08.185,089] <inf> modem_simcom_sim7080: CPIN: 1
00> [00:00:11.238,464] <inf> modem_simcom_sim7080: RSSI: -66
00> [00:00:13.241,851] <inf> modem_simcom_sim7080: CGATT: 1
00> [00:00:14.242,431] <inf> modem_simcom_sim7080: Waiting for network
00> [00:00:14.245,727] <inf> modem_simcom_sim7080: CREG: 5
00> [00:00:15.275,421] <inf> modem_simcom_sim7080: PDP context: 1
00> [00:00:15.275,817] <inf> modem_simcom_sim7080: Network active.
00> [00:00:15.276,123] <inf> golioth_samples: Bringing up network interface
00> [00:00:15.276,489] <inf> golioth_samples: Starting DHCP to obtain IP address
00> [00:00:15.276,855] <inf> golioth_samples: Waiting to obtain IP address
00> [00:00:45.278,869] <inf> modem_simcom_sim7080: RSSI: -62
00> [00:01:15.282,165] <inf> modem_simcom_sim7080: RSSI: -62
00> [00:01:45.285,583] <inf> modem_simcom_sim7080: RSSI: -62

The key issue seems to be:
:white_check_mark: Modem successfully attaches to the network (CGATT: 1, CREG: 5, PDP context active).
:x: Device does not get an IP assigned via DHCP (keeps waiting).
:white_check_mark: An IP is assigned in the 1NCE admin panel, but it is not usable.

#Questions
Is my modem configuration missing anything for DHCP to work correctly?
Should I use a static IP instead of DHCP for 1NCE?

Are there known issues with SIM7080 overload driver and DHCP in Zephyr/Golioth?
Any help or insights would be greatly appreciated! :rocket:

Hey @sebastian,

This suggests a DHCP negotiation issue between the modem and Zephyr’s networking stack.

Since you are using a cellular modem, you should only enable PPP and disable Ethernet. Ethernet mode may be causing conflicts in how Zephyr assigns and manages the modem’s IP, potentially leading Zephyr to prioritize the Ethernet interface over the cellular connection.

CONFIG_NET_L2_ETHERNET=n
CONFIG_NET_L2_PPP=y

If Zephyr tries to use DHCP (CONFIG_NET_DHCPV4=y), the device gets stuck waiting for an IP, even though the modem already has one.

In your configuration file, could you try disabling the following:

CONFIG_NET_L2_ETHERNET=n
CONFIG_NET_DHCPV4=n
CONFIG_GOLIOTH_SAMPLE_DHCP_BIND=n

And let me know if this resolves the issue.

Disabled the flags.


Same behaviour also with better RSSI -52.

Will try to bring the connection up without the sample net_connect() or use the modem_cellular configuration and not the special for sim7080g

device_init(modem);
    pm_device_action_run(modem, PM_DEVICE_ACTION_RESUME);

    // test send
    //net_connect();
	struct net_if *const iface = net_if_get_first_by_type(&NET_L2_GET_NAME(PPP));
    ret = net_if_up(iface);
	if (ret < 0) {
		LOG_ERR("Failed to bring up network interface\n");
		return -1;
	}


    LOG_INF("Waiting for L4 connected\n");
	ret = net_mgmt_event_wait_on_iface(iface, NET_EVENT_L4_CONNECTED, NULL, NULL, NULL,
					   K_SECONDS(120));

	if (ret != 0) {
		LOG_ERR("L4 was not connected in time\n");
		return -1;
	}

	LOG_INF("Waiting for DNS server added\n");
	ret = net_mgmt_event_wait_on_iface(iface, NET_EVENT_DNS_SERVER_ADD, NULL, NULL, NULL,
					   K_SECONDS(10));
	if (ret) {
		printk("DNS server was not added in time\n");
		return -1;
	}

In case of using the CONFIG_MODEM_CELLULAR=y instead of the MODEM_SIM7080 I got following

00> [00:00:16.456,146] <err> golioth_sys_zephyr: eventfd creation failed, errno: 12
00> [00:00:16.456,512] <err> golioth_sys_zephyr: eventfd creation failed, errno: 12
00> [00:00:16.456,909] <inf> golioth_mbox: Mbox created, bufsize: 1232, num_items: 10, item_size: 112
00> [00:00:16.457,977] <err> golioth_sys_zephyr: eventfd creation failed, errno: 12
00> [00:00:16.458,374] <inf> golioth_fw_update: Current firmware version: main - 0.0.2
00> [00:00:16.459,594] <err> golioth_coap_client_zephyr: Fail to get address (coap.golioth.io 5684) -11
00> [00:00:16.460,021] <err> golioth_coap_client_zephyr: Failed to connect: -11
00> [00:00:16.460,388] <wrn> golioth_coap_client_zephyr: Failed to connect: -11

the examples work with MODEM_CELLULAR and udp socket call. The problem is getting the interface up and forward the ip from the modem to the networking.

Hey @sebastian,

This error:

golioth_sys_zephyr: eventfd creation failed, errno: 12

indicates that your application has exceeded the number of available file descriptors, which are used to manage open files, sockets, and other system resources.

To resolve this, you can increase the file descriptor limits by adjusting the following Kconfig settings:

CONFIG_ZVFS_EVENTFD_MAX
CONFIG_ZVFS_OPEN_MAX

Since file descriptors are allocated from system memory, it’s also advisable to increase heap and stack sizes to ensure the application has enough resources to handle additional descriptors:

CONFIG_HEAP_MEM_POOL_SIZE
CONFIG_MAIN_STACK_SIZE
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE

Thank you
should i use the MODEM_CELLULAR or the MODEM_SIM7080 flag?
I just see direkt implementation of COAP on MODEM_SIM7080
https://github.com/zephyrproject-rtos/zephyr/blob/4e4ec9c1e201a49abad9b1207fe0d4872306eeaf/drivers/modem/simcom-sim7080.c#L7

You should enable the CONFIG_MODEM_SIM7080 Kconfig option as it provides the dedicated driver for the SIM7080 modem.

CONFIG_MODEM_SIM7080 enables the dedicated SIM7080 driver in Zephyr, which includes AT command handling, network registration, and power management specifically for the SIM7080 modem.

CONFIG_MODEM_CELLULAR is a generic cellular modem interface used for modems that don’t have a dedicated driver in Zephyr.

1 Like