-
Notifications
You must be signed in to change notification settings - Fork 3k

Description
Description
mbed-cli: 1.8.3
toolchain: cmake_gcc_arm
gcc-arm-none-eabi: 7-2018-q2-update (7.3.1)
mbed-os: 5.11.1
I'm using the CellularContext as a cellular interface and am running into the issue where I don't get more than one connect working. The connect only works once when I reset the device.
I'm using a non-blocking connect call and am checking for NSAPI_STATUS_GLOBAL_UP
to check whether I'm connected. After a connect, I wait for a couple of seconds before disconnecting. Then again waiting a couple of seconds before starting with the connect again. See the code snippet below for what I'm doing as test, where NetworkConnection
is a simple class around CellularContext
/ NetworkInterface
.
This is a simplified example from what I'm trying to do in my application
- Do some measurements or whatever
- Connect to the network
- Send some stuff
- Disconnect from the network
- Go back to 1
See the attached log (0113.log) where I have tracing and AT commands enabled. Also see network_connection.txt for that class.
I don't understand why it would only do this section when I'm connecting for the second time. @AriParkkila any ideas?
Blocking calls don't make any difference.
2019-01-01 13:17:57 [16] Connecting... (submodules/mbed-system/source/main.cpp:334)
[INFO][CELL]: CellularContext set blocking 0
[INFO][CELL]: CellularContext connect
[DBG ][CELL]: checked operation 0 (0)
[DBG ][CELL]: returning
TRACE_DEBUG("Starting network connection test...");
mbed_trace_init();
wtg::connectivity::NetworkConnection network_connection;
for (std::uint8_t i = 0; i < 50; i++) {
TRACE_DEBUG("Connecting...");
if (network_connection.Connect()) {
TRACE_DEBUG("Connected to network: %s", network_connection.IpAddress().c_str());
}
TRACE_DEBUG("Done connecting! (%hhu)", network_connection.GetConnectionStatus());
rtos::ThisThread::sleep_for(5000);
TRACE_DEBUG("Disconnecting...");
network_connection.Disconnect();
TRACE_DEBUG("Done disconnecting! (%hhu)", network_connection.GetConnectionStatus());
rtos::ThisThread::sleep_for(20000);
PRINTF("\n\n\n\n\n");
}
TRACE_DEBUG("network connection test finished!");
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug