Code Monkey home page Code Monkey logo

anjay-freertos-client's Introduction

Anjay-freertos-client

Supported hardware and overview

This repository contains LwM2M Client application based on open-source Anjay library and X-Cube-Cellular package which includes cellular modem drivers, FreeRTOS as well as mbedtls. This example supports the following configurations:

Project Path Board Modem
Projects/STM32L496G-DISCO/UserApp/BG96 P-L496G-CELL02 Discovery kit Quectel BG96 default modem provided with kit
Projects/B-L462E-CELL1/UserApp/TYPE1SC B-L462E-CELL1 Discovery kit Murata TYPE 1SE module with built-in eSIM (ST4SIM-200M)
Projects/B-L462E-CELL1/UserApp/TYPE1SC-AIBP B-L462E-CELL1 Discovery kit Murata TYPE 1SE module with built-in eSIM (ST4SIM-200M)
Supports AI Bridging Protocol.
Projects/B-U585I-IOT02A/BG96
B-U585I-IOT02A Discovery kit Quectel BG96 (provided with P-L496G-CELL02 devkit)

The project was developed using STM32Cube tools (STM32CubeIDE in particular).

The following LwM2M Objects are supported:

  • Security (/0),
  • Server (/1),
  • Device (/3),
  • Firmware Update (/5) (STM32L496G-DISCO and B-L462E-CELL1 projects),
  • Temperature (/3303),
  • Humidity (/3304),
  • Accelerometer (/3313),
  • Magnetometer (/3314),
  • Barometer (/3315),
  • Gyrometer (/3334),
  • Multiple Axis Joystick (/3345).

Cloning the repository

git clone --recursive https://github.com/AVSystem/Anjay-freertos-client

Compilation guide

  • Download STM32CubeIDE
  • Import the cloned project to your workspace
  • In the Project Explorer navigate to one of the [Project Path] taken from the table above, depending on the hardware you use.
  • To build and run the project:
    • For B-U585I-IOT02A board: simply build and run Anjay-freertos-client-B-U585I-IOT02A-BG96 configuration.
    • For STM32L496G-DISCO and B-L462E-CELL1 boards: please follow the instructions in Projects/STM32L496G-DISCO/README.md and Projects/B-L462E-CELL1/README.md respectively.

Connecting to the LwM2M Server

To connect to Coiote IoT Device Management LwM2M Server, please register at https://eu.iot.avsystem.cloud/. Then have a look at the Configuration menu to configure security credentials.

If you use BG96-based configuration, you must upgrade the firmware of the modem to at least BG96MAR02A08M1G revision. Older versions may cause an unexpected loss of connection.

Guide showing basic usage of Coiote DM is available on IoT Developer Zone.

Configuration menu

While connected to a serial port interface, and during bootup, the device shows:

Press any key in 3 seconds to enter config menu...

You can then press any key on your keyboard to enter the configuration menu. After that, you'll see a few configuration options that can be altered and persisted within the flash memory for future bootups.

Module persistence

This application features persistence of Security object, Server object and client's Attribute Storage to retain configuration of those modules over power cycles, to e.g. keep bootstrapped server configuration.

To enable module persistence, set "Use module persistence" option to y in shell config menu. Application will attempt to load those modules from non-volatile memory. Configuration of those modules from shell will be ignored, unless the application fails to restore the state from the memory.

The persisted state of aforementioned modules may be cleared using "Clear module persistence" option.

SIM Bootstrap (commercial feature)

STM32L496G-DISCO-BG96 project now features the SIM Bootstrap that allows bootstrapping the device using the SIM Smartcard. This feature is available only with releases of Anjay that include the bootstrapper commercial feature. To use the SIM Bootstrap feature, define USE_SIM_BOOTSTRAP in the STM32L496G-DISCO-BG96 project settings and make sure that the ANJAY_WITH_MODULE_BOOTSTRAPPER and ANJAY_WITH_MODULE_SIM_BOOTSTRAP options are enabled in Application/Inc/anjay/anjay_config.h.

anjay-freertos-client's People

Contributors

anuar2k avatar jzimnol avatar kucmasz avatar micholek avatar mierunski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anjay-freertos-client's Issues

LWM2M - WICED integration issue

We are integrating Anjay LWM2M client on Murata Type 1LD (cypress psoc). if mbedTLS is enabled there is an error trying to register. Where as the code works in non -secure mode. Also the same code works fine in mbedTLS mode from linux machine. So this has to be an issue with Anjay LWM2M and WICED integration. Trying to debug and not sure what the following error means, any help is much appreciated

Setting IPv6 link-local address
Obtaining IPv4 address via DHCP
IPv6 Network ready IP: FE80::29D:6BFF:FE62:78AA
IPv4 Network ready IP: 192.168.1.195
Wifi network up success
Wifi network up success

TEST Version 1.0.4

*** mbedtls_ctr_drbg_seed ***

entropy_callback

######################## entropy_callback
Seed_callback out buff : 536930016
Initializing Anjay
RunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunningRunning$$$$$ AVS_NET_DTLS_SOCKET $$$$$$
avs_net_dtls_socket_create
WITH SSL
$$$$$create_ssl_socket
configure_ssl socket 0x2000e3cc, configuration= 0x2000e4e8

*initialize_ssl_socket
AVS_NET_SECURITY_PSK

******** initialize_psk_security ******

******************* mbedtls_ssl_conf_psk ###################
Psk key P4s$w0rd length 8
Identity testboard length 9
$$$$$$$ AVS_OK
************_anjay_server_connection_internal_bring_online

Start SSL
**Could not restore session; performing full handshake
MBEDTLS_SSL_CLI_C end point 0
inside mbedtls_ssl_flush_output
wrap_handshake_result Result 0, security mode 1, dane_ta_certs (null) verify_result 0
handshake success: new session started
**Return AVS_OK

ANJAY_REGISTRATION_ERROR_REJECTED
update rejected for SSID 1 needs re-registration
Attempting to register with LwM2M version 1.0
sending Register
lwm2m version 0
coap_base->last_exchange_id 0
(*exchange_ptr)->id 0
avs_time_monotonic_now() second 0 nanosec 9
Register send
Runningget_dtls_overhead
avs_net_socket_send

send_ssl start

Output Bytes:48 2 B4 66 D 88 34 D0 23 5B 8B 31 B2 72 64 11 28 39 6C 77 6D 32 6D 3D 31 2E 30 C 65 70 3D 74 65 73 74 62 6F 61 72 64 5 6C 74 3D 36 30 FF 3C 2F 31 2F 30 3E
send_ssl socket= 0x20015b18 , buffer= 0x20017014 , buffer_length= 53
Going for mbedtls_ssl_write
Handshake not NULL
Client id (null) client id length 0 Host name try-anjay.avsystem.com psk (null) psk_leng 0
Psk key P4s$w0rd ident testboard
Hand shake not over
MBEDTLS_SSL_CLI_C end point 0
inside mbedtls_ssl_flush_output
inside mbedtls_ssl_flush_output
avs_bio_send
avs_net_socket_send
inside mbedtls_ssl_flush_output
avs_bio_send
avs_net_socket_send
wrap_handshake_result Result 53, security mode 1, dane_ta_certs (null) verify_result 0
Hand shake result : 53
RunningReceive_ssl socket = 0x20015b18, buffer= 0x200141e8 , buffer_length= 2048inside mbedtls_ssl_flush_output
MBEDTLS_SSL_CLI_C end point 0
inside mbedtls_ssl_flush_output
wrap_handshake_result Result -76, security mode 1, dane_ta_certs (null) verify_result 0
receive failed: -76
RunningRunningRunningavs_net_socket_send

send_ssl start

Output Bytes:48 2 B4 66 D 88 34 D0 23 5B 8B 31 B2 72 64 11 28 39 6C 77 6D 32 6D 3D 31 2E 30 C 65 70 3D 74 65 73 74 62 6F 61 72 64 5 6C 74 3D 36 30 FF 3C 2F 31 2F 30 3E
send_ssl socket= 0x20015b18 , buffer= 0x20017014 , buffer_length= 53
Going for mbedtls_ssl_write
Handshake not NULL
Client id (null) client id length 0 Host name try-anjay.avsystem.com psk (null) psk_leng 0
Psk key P4s$w0rd ident testboard
Hand shake not over
MBEDTLS_SSL_CLI_C end point 0
inside mbedtls_ssl_flush_output
inside mbedtls_ssl_flush_output
avs_bio_send
avs_net_socket_send
Handshake return -26880
Going for mbedtls_ssl_write
Handshake not NULL
Client id (null) client id length 0 Host name try-anjay.avsystem.com psk (null) psk_leng 0
Psk key P4s$w0rd ident testboard
Hand shake not over
MBEDTLS_SSL_CLI_C end point 0
inside mbedtls_ssl_flush_output
Handshake return -76
wrap_handshake_result Result -76, security mode 1, dane_ta_certs (null) verify_result 0
Hand shake result : -76
socket bio_error
send failed 0 53 : -76
AVS_COAP_CLIENT_REQUEST_FAIL
failure while receiving Register response: Message too long
mapping CoAP error Message too long to network error
ANJAY_REGISTRATION_ERROR_NETWORK
could not register to server 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.