Step 1. To get the temperature and humidity data from the UnaShield V2S, frist you will need to download our code library from the Github as below


Step 2. Download Arduino IDE from Arduino Official Website.

Step 3. Import code library into the Arduino IDE.

Step 4. After the code library have success imported, going to [File] -> [Example], on the bottom you will see the library we have imported.

Step 5. Open a sample code “send-altitude-structured”, and you will see there are 4 files will be open in your window.

Step 6. Next, we're going to modify some code as below to obtain the data what we want. 

First, please select your country Sigfox Radio Zone as transmission frequency. For more information you could refer to the "SIGFOX.h" file in the library.

//  IMPORTANT: Check these settings with UnaBiz to use the SIGFOX library correctly.
static const String device = "";        //  Set this to your device name if you're using SIGFOX Emulator.
static const bool useEmulator = false;  //  Set to true if using SIGFOX Emulator.
static const bool echo = true;          //  Set to true if the SIGFOX library should display the executed commands.
static const Country country = COUNTRY_SG;  //  Set this to your country to configure the SIGFOX transmission frequencies.
static UnaShieldV2S transceiver(country, useEmulator, device, echo);  //  Assumes you are using UnaBiz UnaShield V2S Dev Kit

Second, modify the void loop() section as below:

void loop() {  //  Will be called repeatedly.
  //  Begin Sensor Loop

  //  Read the ambient temperature, humidity.
  float filteredTemp = bme.readTemperature();
  float humidity = bme.readHumidity();

  //  Optional: We may scale the values by 100 so we can have 2 decimal places of precision.
  //  For now we don't scale the values.
  float scaledTemp = filteredTemp * 1.0;
  float scaledHumidity = humidity * 1.0;
  //  End Sensor Loop

  //  Begin SIGFOX Module Loop

  static int counter = 0, successCount = 0, failCount = 0;  //  Count messages sent and failed.
  Serial.print(F("\nRunning loop #")); Serial.println(counter);

  //  Send temperature, humidity as a SIGFOX message.
  String data = transceiver.toHex(scaledTemp)
    + transceiver.toHex(scaledHumidity);
  //  Send the encoded structured message.
  if (transceiver.sendMessage(data)) {
    successCount++;  //  If successful, count the message sent successfully.
  } else {
    failCount++;  //  If failed, count the message that could not be sent.

  //  Flash the LED on and off at every iteration so we know the sketch is still running.
  if (counter % 2 == 0) {
    digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED on (HIGH is the voltage level).
  } else {
    digitalWrite(LED_BUILTIN, LOW);   // Turn the LED off (LOW is the voltage level).
  //  Show updates every 10 messages.
  if (counter % 10 == 0) {
    Serial.print(F("Messages sent successfully: "));   Serial.print(successCount);
    Serial.print(F(", failed: "));  Serial.println(failCount);

  //  End SIGFOX Module Loop

  //  Wait a while before looping. 10000 milliseconds = 10 seconds.
  Serial.println(F("Waiting 10 seconds..."));

Step 7. Connect to your UnaShield V2S with Arduino UNO, go to [Tools] -> [Board] -> Select [Arduino UNO]

After that, go to [Tools] -> [Port], then select the port which your Arduino board have.

Step 8. Verify and upload your code into your Arduino board and open the Serial Monitor.

If your code have running successful, you could see the response as below:

Noted: Please make sure that your configuration below:

  • Serial monitor baud rate: 9600
  • Select the correct USB serial port
  • Board: Arduino/Genuino UNO
  • Make sure upload your code into your Arduino UNO

Step 9. Going to the Sigfox backend, enter into the device information page, select your device type where your device belong and click [Edit]

Step 10. In the device type setting page, find the [Payload display] section -> click [Payload parsing] option -> select [Custom grammar]

Step 11. In the Custom configuration filed, type the config as "temperature::float:32:little-endian humidity::float:32:little-endian" and press ok.

Step 12. Power up your device, and go to the device message tab. As you can see, the temperature(℃) and humidity(%) data value will display just below the raw data which temperature is 27.76℃ and humidity is 41.34375%.

For the code sample, you could refer to the attachment files for more information.