GithubHelp home page GithubHelp logo

u-blox / u-connectxpress-host-library Goto Github PK

View Code? Open in Web Editor NEW
10.0 15.0 7.0 1.37 MB

Host library for short range u-connectXpress modules with AT command and EDM support

Awk 0.08% HTML 84.07% JavaScript 5.64% CSS 0.66% C 9.42% Makefile 0.03% Shell 0.11%
u-connectxpress at-commands wifi-modules ble bluetooth bluetooth-low-energy nina-w13 nina-w15 nina-b1 nina-b2

u-connectxpress-host-library's Introduction

Deprecation note!

Please note: This repository is deprecated and it is no longer actively maintained. We recommend using https://github.com/u-blox/ubxlib instead.

Introduction

The u-connectXpress host library is an example on how to interface the u-blox standalone shortrange modules with a host of any kind. The AT commands are normally transmitted in the AT mode, but this library also supports transmitting AT commands and receiving data using the Extended Data Mode (EDM), which significantly simplifies the development of more advanced products on the host MCU.

The u-connectXpress AT protocol is implemented in the u-connectXpress software for the following u-blox standalone shortrange modules:

  • ANNA-B1
  • NINA-B1
  • NINA-B2
  • NINA-B31
  • NINA-W13
  • NINA-W15
  • ODIN-W2

Use this library on the host to

  • Transmit AT commands to the module using AT mode or EDM
  • Receive and manage URC responses using AT mode or EDM
  • Transmit raw data to any peer connected to the module using Data mode or EDM
  • Receive raw data from any peer connected to the module using Data mode or EDM

While this example is written for Windows, it is trivial to convert it to any other host, including Raspberry PI, FreeRTOS, or hostless embedded MCUs such as STMicroelectronics STM32 series.

Usage

Running your first example on CygWin

The example will issue some commands to your module, and display the responses.

  • Connect a NINA-W13, NINA-W15 or ODIN-W2 to your computer.

  • Define the serial port to use in the include/ucxh_config.h file.

  • Open a command terminal on your PC and start

    ./runExamples.sh --run ex_readmisc
    

\ref ex_readmisc "More information ..."

Running the second examples on CygWin

This example will show how to communicate with another device over WiFi, using EDM between your NINA-W13, NINA-W14 or ODIN-W2 module and your PC.

  • Connect a NINA-W13, NINA-W15 or ODIN-W2 to your computer.

  • Define the serial port to use in the include/ucxh_config.h file.

  • Configure your network and create a small server. This can be done either by connecting to your existing network, and using your computer as a server, or by using another NINA-W10/W13 or ODIN-W2 as WiFi AP and/or server.

    • To use another u-blox module as WiFi AP and server, configure it to use IP number and gateway address 192.168.2.1, and enable a TCP server on port 12345. This is easiest done using s-center.

      • In s-center, connect to the u-blox standalone module you intend to use as WiFI AP.

      • From the File menu, select Download Configuration and select the file resources/config_ex_callbacks_edm_wifi.txt.

      • Once the module has activated the WiFi AP, enter Data Mode, by pressing the button at the bottom.

      • Open a command terminal on your PC and start

         ./runExamples.sh --run ex_callbacks_edm_wifi
        
      • When propmted by the example, type something into the s-center input box. Some text appears on the program's terminal, and the example will echo back the result.

    • To use your own network and PC as server you need some form of program capable of accepting incoming connections on your pc, such as nc.

      • Edit the examples/ex_config.h file, and replace the SSID, and password with the one used on your network, and the IP-number with your PC's IP-number.

      • Open a command terminal on your PC, start netcat using

        nc -l -k 12345
        
      • Open a new terminal on your PC and start

        ./runExamples.sh --run ex_callbacks_edm_wifi
        
      • When propmted by the example, type something into netcat's terminal. Some text appears on the program's terminal, and the example will echo back the result.

Independent on method, the example will quit automatically after 2 minutes. It can also be aborted by sending the line quit from the server.

\ref ex_callbacks_edm_wifi "More information ..."

Using the AT command library with your host application

  • ensure your include/ucxh_config.h is configured properly
  • Compile and link the files in the src directory as well as the src/windows/ucxh_serial_win.c file with your application.

Documentation

See the examples for various use-cases

For full documentation see the html/index.html file.

For documentation on the EDM packet format, see the u-blox Extended Data Mode Protocol Specification at https://www.u-blox.com/en/docs/UBX-14044126

For documentation on the u-blox u-connectXpress AT command set for the u-blox shortrange standalone modes, see the u-connect AT commands manual at https://www.u-blox.com/en/docs/UBX-14044127

Examples

ex_readmisc

This example shows how to read various parameters from the module.

\ref ex_readmisc "More information ..."

ex_callbacks_edm_wifi

This example is a shows how to connect to a remote host using EDM:

  • Enter Extended Data Mode (EDM)
  • Configure the module as a WiFi station
  • Wait until the WiFi link is up and the module has received a DHCP IP address.
  • Connect to a server (for example a PC)
  • Transmit raw data to the server
  • Receive raw data from the server
  • Reboot

\ref ex_callbacks_edm_wifi "More information ..."

Porting

The library has been tested using gcc on CygWin, with the only file which contains Microsoft Windows-specific code, is ucxh_serial_win.c, in the src/windows directory.

Replace that file with code which implements the interface described in serial.h .

In order to port to an RTOS, such as FreeRTOS, a few lines needs to be changed in atParseResponse() of the src/ucxh_parser.c file

Testing

A number of test programs for unit-tests, and some programs with an expected output are also available, when runExamples.sh is executed:

Unit-tests

test_getgeneral

Unit-test for the generation and parsing of General commands from chapter 3 in the u-connectXpress AT command manual.

\ref test_getgeneral.c "More information ..."

test_getsystem

Unit-test for the generation and parsing of System commands from chapter 4 in the u-connectXpress AT command manual.

\ref test_getsystem.c "More information ..."

test_at_wifi

Unit-test for the generation and parsing of WiFi commands from chapter 7 and some Network command from chapter 10 in the u-connectXpress AT command manual.

\ref test_at_wifi.c "More information ..."

test_tokenizer

Unit-test for the tokenizer part of the library.

\ref test_tokenizer.c "More information ..."

test_send

Unit-testing the functions used for building and sending AT commands.

\ref test_send.c "More information ..."

test_mock_ati9

Unit-testinf for the actual mocking framework, mimicing the behavior of \ref test_ati9.c .

\ref test_mock_ati9.c "More information ..."

Manual test

test_ati9

This test is a basic "Hello, World", which - using AT mode - tests

  • Open the serial port
  • Enter AT mode
  • Transmit an AT command
  • Receive the response
  • Close the serial port

\ref test_ati9.c "More information ..."

test_datamode

This test is a partial test which - using AT mode and Data mode - tests

  • Enter the Data mode
  • Transmit raw data in the Data mode

\ref test_datamode.c "More information ..."

test_edm_at

This test is a basic Hello, World, which - using EDM - tests

  • Enter EDM mode
  • Transmit an AT command
  • Receive the response
  • Leave EDM mode

\ref test_edm_at.c "More information ..."

test_edm_at_read

This test is a basic Hello, World, which - using EDM - tests

  • Enter EDM mode
  • Ensure nothing is received apart from responses from AT-c
  • Leave EDM mode

\ref test_edm_at.c "More information ..."

All testing has been done using gcc 9.2.0 on CygWin connected to either NINA-W152 2.1.0 or NINA-W132 2.1.0.

Using runExamples.sh

By default, it will

  • Run all examples
  • Execute all automatic unit-tests
  • Execute all manual unit-tests
  • Re-generate all documentation (assuming doxygen and graphwiz is installed).

Disclaimer

Copyright (C) u-blox

u-blox reserves all rights in this deliverable (documentation, software, etc., hereafter “Deliverable”).

u-blox grants you the right to use, copy, modify and distribute the Deliverable provided hereunder for any purpose without fee.

THIS DELIVERABLE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR U-BLOX MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS DELIVERABLE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.

In case you provide us a feedback or make a contribution in the form of a further development of the Deliverable (“Contribution”), u-blox will have the same rights as granted to you, namely to use, copy, modify and distribute the Contribution provided to us for any purpose without fee.

u-connectxpress-host-library's People

Contributors

fredriklundstromublox avatar magnushanssonublox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

u-connectxpress-host-library's Issues

building the library for STM32

Hi,
I cloned the repository into a projects directory and ran make it errors on header files.
Why? I thought this was a no-brainer!
Doing the same thing with a cross-compiler yields similar results.
After modifying the makefile to add the needed include directories however I still get errors on all sorts of things.
Has anyone actually cloned this repo and performed a successful build and if so under what environment?
MinGW, Cygwin, Cross compiler so ARM, VS Code?

Implementing Bluetooth

Bluetooth seems partially implemented, is there any plan to come back and fullly implement it?

Use these libraries on Arduino

Hi.

[Not an Issue, just a Discussion]

Can these libraries be used in Arduino? I've got a board which has Ublox W152 integrated on it with UART interface. I've been looking for the AT command drivers/libraries which I can use to build my application on Arduino. End goal is to connect to a Wifi network and send or receive data via UDP.

Please let me know and any information would be highly appreciated.

Thanks,
Akshay

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.