Important changes compared to version 3 of the library, valid for every sketch including v4 :

No need to include SoftwareSerial library in your sketch

RX/TX definition happens in the sketch instead of the .cpp file (that way it's easier to adapt the code for an Akene or a TD1208 breakout)

The payload is a String object instead of a structure struct

Data must be converted in hexadecimal prior to sending, with toHex()

No need to insert delays or call isReady() to manage the timing between two messages, sendPayload() already does it.

Description

The Akeru library enables Sigfox connectivity for your Arduino. It allows you to define the RX/TX pins directly in your sketch, fetch data from the modem (temperature, revision numbers...), send and receive messages on the Sigfox network.

Organization

Akeru.h : Header file to be included in your sketchAkeru.cpp : Definition of the global object Akeru and its associated methods/examples : Folder containing examples of use - DemoTest : complete demonstration of the library, requests every available parameter and sends a message on the network - downlinkDemo : how to receive data from the network - sendMultipleValues : how to send multiple variables in a single message - sendSingleValues : how to send values from a single sensor

echoOn()Prints AT commands and TD1208's answers on the serial monitor. Inactive by default.

echoOff()Disables AT commands & answers echo. Active by default.

begin()To be used in the setup() of your sketch.

isReady()Indicates if the modem is ready to send a new message (more precisely if enough time passed between 2 messages, so you don't send too many). Its use may be redundant since this function is called each time a message or a downlink request is sent.

sendAT()Sends a simple AT command.

sendPayload(const String payload)Sends data on the Sigfox network. Prior to sending, data must be formatted in hexadecimal with toHex().

getTemperature(int *temperature)Gets the modem temperature.

getID(String *id)Gets the modem's ID (equal to the ID on the modem's sticker)

toHex(char *c, int length)Converts a string in hexadecimal. The array's size must be known (use sizeof). Returns a String containing the data to be sent.

receive(String *data)Enables downlink, waits for an answer from the network. Received data is hexadecimal.

- Sending multiple values -

When you need to send several values on the Sigfox network in a single message, you need to put all the data in the same payload. You can do this easily with the concatenation operators from the String library :