Commit graph

520 commits

Author SHA1 Message Date
Emil Lindqvist b610312314 modem_cellular: add registration status API
This commit implements a network registration status API,
including return of reject cause in case of denial.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-03-14 16:30:57 +00:00
Ryan Erickson 06c62e4c17 modem: modem_cellular: fixes for hl7800
Add connect match for dialing PPP connection.
Ensure PDP authentication is disabled.
Request manufacturer, firmware version, and IMSI from the modem.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-03-13 13:05:51 -05:00
Lucas Denefle 08aa504e66 modem: modem_cellular: increase imsi size
Fixes an issue introduced with `080d51bb`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2024-03-13 09:46:38 -05:00
Lucas Denefle b287ad70f8 modem: modem_cellular: increase imei size
Fixes an issue introduced with `b668296a`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2024-03-13 09:46:38 -05:00
Lucas Denefle fe4f002eef modem: modem_cellular: increase model_id size
Fixes an issue introduced with `08a51bae`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2024-03-13 09:46:38 -05:00
Lucas Denefle c36b1039be modem: modem_cellular: increase manufacturer size
Fixes an issue introduced with `ae951f5f`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2024-03-13 09:46:38 -05:00
Lucas Denefle 4cd0dee7cc modem: modem_cellular: increase fw_version size
Fixes an issue introduced with `adcdf64a`

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2024-03-13 09:46:38 -05:00
Tomi Fontanilles fd5c76ddfd drivers: modem_cellular: allow leaving out the chat_filter parameter
Allow not specifying the chat_filter parameter in a device
definition, which is equivalent to setting it to "".

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-03-07 21:38:24 +00:00
Tomi Fontanilles 62d84fb322 drivers: modem_cellular: fine tune nRF91's shutdown_time
A shutdown lasting more than 5 seconds was experienced.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-03-04 22:13:14 +01:00
Tomi Fontanilles 9a3dbaf993 drivers: modem_cellular: add nRF91 series (w/ SLM)
The nRF91 series devices, when running the Serial LTE Modem (SLM)
application starting with nRF Connect SDK 2.6.0, can now be used as
standalone modems via the generic modem_cellular driver.

A configuration to run the cellular_modem sample on the nRF9160 DK
(plugged in to another nRF91 series device running SLM) is provided.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-03-03 18:59:22 +01:00
Tomi Fontanilles c6176b523a drivers: modem_cellular: make the buffer sizes configurable
To allow fine tuning and accommodate modem differences.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-03-03 18:59:22 +01:00
Tomi Fontanilles 0f5b3269df drivers: modem_cellular: allow variable length chat delimiter and filter
To allow for differences between modems.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-03-03 18:59:22 +01:00
Jukka Rissanen 8860a81cfe drivers: Change drivers to support new IPv4 netmask setting API
Make sure that the drivers use the new IPv4 netmask setting API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-03 18:58:29 +01:00
Ryan Erickson 034fc93db7 modem: hl7800: Fix null reference in hl7800_net_addr6_pton
Ensure a potential null pointer is not incremented.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-15 22:17:43 +01:00
Ryan Erickson 63d6ea958e modem: hl7800: fix parsing APN username
Ensure a null reference cannot happen if there is an issue
parsing the APN username.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-14 19:08:13 +01:00
Ryan Erickson d8afcfb501 modem: hl7800: validate IPv4 DNS addr len for IPv6
If the IPv6 DNS address is not a valid address, DNS will fallback
to the IPv4 DNS address.
Fix copying the IPv4 address to the IPv6 address by using
the IPv6 address destination length.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-14 19:03:02 +01:00
Bjarki Arge Andreasen 080d51bb36 modem: modem_cellular: CID 338067
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen b668296a50 modem: modem_cellular: CID 338073
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen 08a51bae89 modem: modem_cellular: CID 338115
incorrect size passed to strncpy()

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen ae951f5f02 modem: modem_cellular: CID 338140
incorrect size passed to strncpy

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Bjarki Arge Andreasen adcdf64a0f modem: modem_cellular: CID 338164
strncpy() passed incorrect size

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-02-14 17:48:11 +01:00
Ryan Erickson cc1d545619 modem: bg9x: ignore sem return value
The semaphore waits forever, ignore the return value.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-13 10:25:23 +01:00
Thomas Stranger cbc75f8504 drivers: modem: ublox-sara-r4: freeaddrinfo mark unused param
The res param in offload_freeaddrinfo is not used.
Mark it as unused, to avoid static analysis complaining about
Parse warning (PW.PARAM_SET_BUT_NOT_USED)
Fixes CID 316235

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-02-08 07:03:48 +01:00
Ryan Erickson b65ab5fe88 modem: hl7800: check sem take in event handler
Only execute event callbacks if the semaphore is successfully taken.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-08 07:03:30 +01:00
Ryan Erickson 34ec42b8f3 modem: hl7800: sock_read len arg is not used
The static function sock_read does not need a length arg, remove it.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2024-02-08 07:03:12 +01:00
Parthiban Nallathambi fd85021718 modem: change log level of events prints to debug
info level is printed always to console and it's noisy.
Change to debug level, which can be enabled with
CONFIG_MODEM_MODULES_LOG_LEVEL_DBG

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2024-02-06 13:00:05 +01:00
Flavio Ceolin d4ba37739f drivers: modem/simcom: Unused variable
Make coverity happy and mark a variable as unused.

Fixes CID-248325
Fixes #58572

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-02-01 14:06:27 +01:00
Bjarki Arge Andreasen 27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Parthiban Nallathambi db429004fd drivers: modem: gsm fix rssi range
rssi 31 will be -51dBm or greater, where -51 is valid. Fix the
range by allowing until -51.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2024-01-19 15:15:03 +00:00
Emil Lindqvist 342e10b0b8 modem_cellular: add RSRP & RSRQ to U-blox SARA-R5 modem
This commit implements parsing of the CESQ extended signal quality AT
command, extracting RSRP and RSRQ which is relevant for LTE connections.
It's used in the U-blox SARA-R5 modem instance. Furthermore, the IMEI,
IMSI is extracted in the same modem.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-01-16 14:15:56 +00:00
Bjarki Arge Andreasen 1ee092673a modem: modem_cellular.c: Remove non standard QCCID handler
The QCCID handler is Quectel specific and as such may not be part
of the modem cellular driver which only supports commands defined
in 3GPP TS 27.007

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-03 10:21:18 +01:00
Bjarki Arge Andreasen 572c5e6d5a modem: modem_cellular: Rework cellular_get_signal implementation
The modem_cellular.c driver now uses a common script to get
signal strenght, which is run on demand. This is more efficient
than polling it, and simpler since every modem doesn't have to
define their own variant of the script.

Additionally, the CSQ handler now stores the "raw" rssi value
returned from AT+CSQ to be parsed by the cellular_modem_get_signal
implementation.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-03 10:21:18 +01:00
Bjarki Arge Andreasen f9491034be modem: modem_cellular: Update driver to implement cellular API
Move the implementations of the cellular API in modem_cellular.c
to an cellular_driver_structure, and implement this API structure
withing the device drivers.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-03 10:21:18 +01:00
Alessio Lei 733b81d2c7 drivers: modem: remove dependency of modem_socket
Fixed Kconfig to remove dependency between modem_socket and
modem_context, the two do not depend on each other and
should be possible to use independently

Signed-off-by: Alessio Lei <alelei94@yahoo.it>
2023-12-14 09:31:51 +01:00
Lucas Denefle d1ba79a070 drivers: cellular: add signal and modem_info API
Implement modem info pulling using the init and periodic chat scripts

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2023-12-12 19:09:33 +01:00
Ryan Erickson 8deaf18d8b drivers: modem: hl7800: fix low power modes
Do not allow the modem to sleep if the driver is busy.
Fix CTS filtering. Ignore small pulses on the CTS line.

Fix socket restoration. Restored sockets could be mismatched
with a wrong type.
UDP sockets could be duplicated during restore.

Improve IO debug mode. Use warning message for IO debug mode
to easily see IO transitions color coded in a terminal.

Ensure the UART is enabled whenever the driver needs to send
commands to the modem.

Ensure DNS resolver is re-initialized after the modem is powered off.

PROD-307

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2023-12-08 10:26:04 +00:00
Emil Lindqvist 1cd7c55af9 modem: modem_cellular: add U-blox SARA-R5 as modem
U-blox SARA-R4 already exists but the behavior is different,
requiring a separate driver instance. For instance, R5 autostarts,
so this commit also adds support for skipping power on pulse.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2023-12-05 16:29:55 -06:00
Emil Lindqvist 79c2fafe6a modem: modem_cellular: add PAP authentication support
Some modems or networks require PAP authentication for successful
LCP handshake. Tested on U-blox SARA-R5 with zephyr,gsm-ppp.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2023-12-01 10:51:24 +00:00
Jukka Rissanen f70e4c0f68 drivers: modem: Fix include paths
Set the include paths properly and unconditionally to needed
networking directories.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-21 08:48:04 +00:00
Benjamin Cabé f3b85ad92c drivers: modem: fix for possible non-null terminated string
Fix handling of strncpy in cgnsinf parsing function to avoid
potentially getting a non-null terminated string.
Fixes #58573 / CID: 248403

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-20 09:23:32 +01:00
Lucas Denefle f9d0a4c5cf drivers: modem: add Quectel EG25-G
This commit introduces support for the modem EG25-G from Quectel.

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
2023-11-13 10:10:15 -06:00
Bjarki Arge Andreasen 5639bc0330 modem: modem_cellular: Fix build errors
Build errors where introduced by
c76d5b882c and are fixed with this
commit. They are trivial fixes of malformed lines.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-06 16:06:36 +01:00
Bjarki Arge Andreasen c76d5b882c drivers: modem: modem_cellular: Patch init scripts
The init scripts need a missing wait for OK after sending
AT+CGMM and the AT+CMUX command specifies more parameters
than nessesary, and in some cases incorrectly.

This commit adds the missing wait for OK and fixes the AT+CMUX
commands in the init scripts.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-06 10:09:48 +01:00
Jeff Welder 372216a3ea drivers: modem: modem_cellular: add Telit ME910G1
Added chat script and initial config to support Telit ME910G1.
Needed to edit power_pulse pin timing in accordance to datasheet.

Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
2023-11-02 08:34:50 +00:00
Jeff Welder ed8f0bc985 drivers: modem: Individualize Modem Device Macros
Refactor device macro to be custom for each modem
to allow custom configurations.

Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
2023-11-02 08:34:50 +00:00
Benedikt Schmidt ba49cb81f1 drivers: modem: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Tahir Akram 7c7c8f193e drivers: modem: introducing config for cereg/creg for gsm
This contribution addresses the support for various types of modems in
gsm driver. As some 4G modems have failed to return correct output
from AT+CREG?, so AT+CEREG? is the right AT command in such situation.
This commit provides the possibility for user to select one type of
AT command. This PR fixes zephyrproject-rtos#63917

Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
2023-10-20 15:13:08 +02:00
Andrei Emeltchenko d661c86e35 drivers: modem_cellular: Fix missing break
There is no fallthrough statement or comment so I assume break is
missing.

Fixes build time warning from some tools.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-10-13 17:42:40 +03:00
Bjarki Arge Andreasen 0339f2d41f modem: modem_cellular: Adjust chat scripts
This commit adjust the chat scripts for the simcom
sim7080 and gsm_ppp compatibles to fix an issue found
when trying to use a sim7080 modem. The CMUX command
includes optional parameters which are not identical
for all modems, so the AT+CMUX command has been adjusted
to only contain the mandatory parameters.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-10-11 18:57:11 +03:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00