Skip to content

UBee

Passthrough

With the passthrough sketch you can send AT commands (NB-IoT) to the ublox module on the ubee.

Follow the steps on the Mbili or Autonomo support pages to install the required board files.

This example doesn’t require any additional libraries. Simply plug the bee into your Mbili or Autonomo and upload the example code.

/*
 * SODAQ UBee - Serial Passthrough
 *
 * This sketch is tested with the UBee with the N2 and the R4 module in combination 
 * with a SODAQ Autonomo and SODAQ Mbili
 * The UBee will work on every board with a (x)bee pinout.
 * The Mbili does not wok with the R4 module, it can't handle the fast baudrate.
 *
 * If you have questions about this sketch you can ask them on forum.sodaq.com
 */

#include <Arduino.h>

// #define R4XX // Uncomment when you use the ublox R4XX module

#if defined(ARDUINO_SODAQ_AUTONOMO)
/* SODAQ AUTONOMO + SODAQ (uBlox SARA) UBee */
#define DEBUG_STREAM SerialUSB
#define MODEM_STREAM Serial1
#define powerPin BEE_VCC
#define enablePin BEEDTR
#define powerTogglePin BEERTS

#elif defined(ARDUINO_AVR_SODAQ_MBILI)
/* SODAQ MBILI + SODAQ (uBlox SARA) UBee */
#define DEBUG_STREAM Serial
#define MODEM_STREAM Serial1
#define powerPin 20
#define enablePin BEEDTR
#define powerTogglePin BEERTS

#else
#error "Please use one of the listed boards or add your board."
#endif

#ifdef R4XX
    // Start at 115200 allow the USB port to change the Baudrate.
    unsigned long baud = 115200;  
#else
    // Start at 9600 allow the USB port to change the Baudrate.
    unsigned long baud = 9600;
#endif

void setup()
{
#ifdef powerPin
  // Turn the nb-iot module on
  pinMode(powerPin, OUTPUT);
  digitalWrite(powerPin, HIGH);
#endif

#ifdef enablePin
  // Set state to active
  pinMode(enablePin, OUTPUT);
  digitalWrite(enablePin, HIGH);
#endif // enablePin

#ifdef R4XX
    // The R4XX module has an on/off pin. 
    // You can toggle this pin or keep it low to switch on the module.
    pinMode(powerTogglePin, OUTPUT);
    digitalWrite(powerTogglePin, LOW);
#endif

  delay(100);

  // Start communication
  DEBUG_STREAM.begin(baud);
  MODEM_STREAM.begin(baud);

  delay(1000);
}

// Forward every message to the other serial
void loop()
{
  while (DEBUG_STREAM.available())
  {
    MODEM_STREAM.write(DEBUG_STREAM.read());
  }

  while (MODEM_STREAM.available())
  {
    DEBUG_STREAM.write(MODEM_STREAM.read());
  }
}

Note

The Mbili can not handle the high baudrate of the R4 module.

Library

You can install libraries with the Arduino Library manager.

Open Arduino
Click on Sketch > Include Libraries > Manage Libraries…

Search for Sodaq_N2X, Sodaq_R4X or Sodaq_3Gbee(2G/GPRS and 3G) depending on your module. Click on the bar to show the install button and install the library.

Click on File > Examples > [library name] to see more example codes.

Our libraries can also be found on GitHub.
Sodaq_R4X
Sodaq_N2X
Sodaq_3Gbee

Schematics

ubee_schematic

Firmware updates

Contact your u-blox representive to obtain the latest firmware.

N2

With the command ATI9 you can check your firware version. Result N2 should be: 06.57,A10.08

Note

The N2 modules need to be updated to 06.57,A07.03 before updating to 06.57,A09.06.
The N2 modules need to be updated to 06.57,A09.06 before updating to 06.57,A10.08.

  1. Load the passthrough sketch on your board.
  2. Open UEUpdater.
  3. Select the correct firmware file.
  4. Press the Update button and wait for 60 seconds.
  5. The programm tells you the update is complete.
  6. Your module is updated!

Ubees with SARA N2 modules can be updated through the serial interface.

Note

You need a board who can handle the 115200 baudrate.
The Mbili can not handle the high baudrate which is needed to upgrade the module.

R4

With the command ATI9 you can check your firmware version.

The latest firmware version for the R412 is M0.10.00,A.02.14.
The latest firmware version for the R410 is L0.0.00.00.05.08,A.02.04.

Note

From these firmware versions it's required to set a MNO Profile.

Ubees with SARA R4 modules can be updated with soldering an usb cable to the usb pins and turning the module on.

  1. Contact u-blox for the latest firmware and update tool.
  2. Solder the USB to the update pins, to directly communicate with the u-blox module.
    ubee_sara_pins
  3. Load the passthrough sketch on your board.
  4. Install EasyFlash.
  5. Reboot PC.
  6. Put the firmware file in the installation directory.
  7. Open EasyFlash as administrator.
  8. Select R4 and USB, leave baudrate empty.
  9. Hit Start and relax till the update is successful.

Other modules

All other Ubees shouldn’t require an firmware update.