Re-Mote is a powerful development board to build real IoT projects and solutions. Re-Mote IoT hardware board was developed by Zolertia.io with universities and industrial partners from different countries in the context of a European Project to create powerful IoT hardware for Smart cities, logistics, lighting and industrial project. Fully compatible with main IoT operating systems.

Requirements

To complete this tutorial, you’ll need:

Setup

1.- Clone Zolertia pack repository if you don’t have it already Zolertia contiki.

git clone https://github.com/Zolertia/contiki.git

  • Update the repository:

git submodule update --init

  • Change to branch Zolertia-Packs:

git checkout Zolertia-packs

2.- Program the binary files on Orion Router for connectivity to the internet over 6lbr and create a 6LoWPAN network. To program a device use the cetic_6lbr_router_eth_gw.bin image.

You should see something like this:

/contiki/examples/zolertia/tutorial/99-apps/mqtt-node$ python ../../../../../tools/cc2538-bsl/cc2538-bsl.py -e -w -v -a 0x200000 Binaries/router cetic_6lbr_router_eth_gw.bin 
Opening port /dev/ttyUSB0, baud 460800
Reading data from Binaries/router/cetic_6lbr_router_eth_gw.bin
Firmware file: Raw Binary
Connecting to target...
CC2538 PG2.0: 512KB Flash, 32KB SRAM, CCFG at 0x0027FFD4
Primary IEEE Address: 00:12:4B:00:06:16:0E:52
Erasing 524288 bytes starting at address 0x00200000
    Erase done
Writing 524288 bytes starting at address 0x00200000
Write 16 bytes at 0x0027FFF0F8
    Write done                                
Verifying by comparing CRC32 calculations.
    Verified (match: 0x57ee5c91)
  • Enter to mqtt-node folder:

cd /contiki/examples/zolertia/tutorial/99-apps/mqtt-node

  • Download the image:

$ python ../../../../../tools/cc2538-bsl/cc2538-bsl.py -e -w -v -a 0x200000 Binaries/router cetic_6lbr_router_eth_gw.bin

3.- Plug Ethernet cable and supply by PoE or USB.

4.- Notice the Border Router also advertise a local IPv6 address (bbbb::/64 as default), being the default Border Router address the bbbb:100.

We can use this address to also talk to the Border Router using IPv6.

5.- Now open a browser and using [bbbb::100].

This is the 6lbr webservice, it show the Border Router status and configuration options. You can manage and configure both the IPv4/IPv6 and 6LoWPAN networks, and also manage the wireless nodes in the 6LoWPAN network.

6.- In Configuration tab you have all network parameters, both 802.15.4 and Eth network. For this example the security is enabled on 6LoWPAN network and is necessary ennable it on router:

  • Link-layer security : Pre-shared
  • Link-layer security level: AES-CCM-128
  • Enable anti-replay workround: on

7.- Submit and reset Orion Router.

Hardware Connection

The RE-Mote uses a 5 and 3 pins connectors, the relay can be connected on ADC1, soil moisture should be connected on ADC3 because can provide 5V on signal pin. 

Ubidots Application

1.- From your Ubidots account get the token. Then we will need to set ‘Default token’ as shown:

2.- Include the token in the header of the platform ubidots.h.

#define DEFAULT_CONF_AUTH_TOKEN       ""  /* Not used */
#define DEFAULT_CONF_AUTH_USER        "pcJe4icxXXXXXXXXXXXXXXXXXXXXXX"#define DEFAULT_ORG_CONF_ID           "zol:001"

3.- Verify in Makefile that:

  • MQTT_PLATFORM ?= ubidots
  • MQTT_SENSORS ?= ubidots_demo
# Platform options: relayr, thingsio, bluemix, ubidots
MQTT_PLATFORM ?= ubidots# Sensor options: fridge, coldchain, agriculture, watering, remote, coinbox,
#                  flowerpot, smartcities, ubidots_demo
MQTT_SENSORS  ?= ubidots_demo

4.- Compile the application and program RE-Mote.

$ make clean && make TARGET=zoul BOARD=remote-revb mqtt-client.upload 

contiki/examples/zolertia/tutorial/99-apps/mqtt-node$ make clean && make TARGET=zoul BOARD=remote-revb mqtt-client.upload
using saved target 'zoul'
rm -f *~ *core core *.srec \
    *.lst *.map \
    *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \
    *.ce *.co
rm -rf *.zoul symbols.c symbols.h *.d *.elf *.hex
rm -rf obj_zoul
mkdir obj_zoul
  CC        ../../../../../cpu/cc2538/./ieee-addr.c
  CC        ../../../../../cpu/cc2538/cc2538.lds
  CC        ../../../../../cpu/cc2538/./startup-gcc.c
  CC        ../../../../../apps/mqtt/mqtt.c
  CC        ../../../../../platform/zoul/dev/adc-zoul.c
  ...
  ...
  ...
  CC        ./internals/mqtt-sensors.c
  CC        ./internals/mqtt-res.c
  CC        ./cloud/ubidots.c
  CC        ./device/ubidots_demo.c
  LD        mqtt-client.elf
arm-none-eabi-objcopy -O binary --gap-fill 0xff mqtt-client.elf mqtt-client.bin
Flashing /dev/ttyUSB0
Opening port /dev/ttyUSB0, baud 460800
Reading data from mqtt-client.bin
Firmware file: Raw Binary
Connecting to target...
CC2538 PG2.0: 512KB Flash, 32KB SRAM, CCFG at 0x0027FFD4
Primary IEEE Address: 00:12:4B:00:06:0D:B3:3C
Erasing 524288 bytes starting at address 0x00200000
    Erase done
Writing 516096 bytes starting at address 0x00202000
Write 8 bytes at 0x0027FFF8F00
    Write done                                
Verifying by comparing CRC32 calculations.
    Verified (match: 0x2fe9a913)
rm obj_zoul/ubidots.o obj_zoul/startup-gcc.o mqtt-client.co obj_zoul/ubidots_demo.o

5.- When the RE-Mote is connected with Router on Sensor tab the device is listed:

6.- Once the RE-Mote is connected with the Orion, Ubidots should automatically create the variables inside the device.

Now you can build dashboards and configure alerts. To learn more about dashboards check out this video.

Did this answer your question?