Skip to content

Commit

Permalink
Updated RE-Mote revision A support and cleaning up Zolertia platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
alignan committed Nov 24, 2015
1 parent b25117a commit 27fd1a5
Show file tree
Hide file tree
Showing 86 changed files with 2,011 additions and 863 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*.c128
*.c64
*.cc2538dk
*.remote
*.zoul
*.jn516x
*.srf06-cc26xx
*.ev-aducrf101mkxz
Expand Down
1 change: 0 additions & 1 deletion examples/remote/Makefile.target

This file was deleted.

1 change: 0 additions & 1 deletion examples/z1/ipv6/z1-websense/Makefile.target

This file was deleted.

15 changes: 0 additions & 15 deletions examples/z1/tutorials/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion examples/z1/Makefile → examples/zolertia/z1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ CONTIKI_PROJECT += test-potent
endif

all: $(CONTIKI_PROJECT)
CONTIKI = ../..
CONTIKI = ../../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
all: z1-websense

CONTIKI=../../../..
CONTIKI=../../../../..

SMALL=1

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/remote/Makefile → examples/zolertia/zoul/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
CONTIKI_PROJECT = remote-demo test-tsl2563 test-sht25
CONTIKI_PROJECT = zoul-demo test-tsl2563 test-sht25
CONTIKI_TARGET_SOURCEFILES += tsl2563.c sht25.c

all: $(CONTIKI_PROJECT)

CONTIKI = ../..
CONTIKI = ../../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/zolertia/zoul/Makefile.target
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TARGET = zoul
8 changes: 8 additions & 0 deletions examples/zolertia/zoul/cc1200-demo/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
CONTIKI_PROJECT = cc1200-demo

all: $(CONTIKI_PROJECT)

CONTIKI = ../../../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/zolertia/zoul/cc1200-demo/Makefile.target
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TARGET = zoul
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* Copyright (c) 2015, Zolertia - http://www.zolertia.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand All @@ -26,106 +26,80 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
*/

/*---------------------------------------------------------------------------*/
/**
* \addtogroup zoul-cc1200-demo Zoul on-board CC1200 RF transceiver test
*
* Demonstrates the use of the TI CC1200 RF transceiver on Sub-1GHz
* @{
*
* \file
* Best-effort single-hop unicast example
* Test file for the CC1200 demo
*
* \author
* Adam Dunkels <[email protected]>
* Antonio Lignan <[email protected]>
*/

#include "contiki.h"
#include "net/rime/rime.h"

#include "dev/button-sensor.h"

#include "cpu.h"
#include "sys/etimer.h"
#include "dev/leds.h"
#include "dev/watchdog.h"
#include "dev/serial-line.h"
#include "dev/sys-ctrl.h"
#include "net/rime/broadcast.h"

#include <stdio.h>
#include "dev/i2cmaster.h"
#include "dev/tmp102.h"

#if 1
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...)
#endif


#define SENDER 205
#define RECEIVER 200


#define PRINTFDEBUG(...)


#define TMP102_READ_INTERVAL (CLOCK_SECOND/2)

int16_t tempint;
uint16_t tempfrac;
int16_t raw;
uint16_t absraw;
int16_t sign;
char minus = ' ';

#include <stdint.h>
/*---------------------------------------------------------------------------*/
PROCESS(example_unicast_process, "Example unicast");
AUTOSTART_PROCESSES(&example_unicast_process);
#define LOOP_PERIOD 2
#define LOOP_INTERVAL (CLOCK_SECOND * LOOP_PERIOD)
#define BROADCAST_CHANNEL 129
/*---------------------------------------------------------------------------*/
static struct etimer et;
static uint16_t counter;
/*---------------------------------------------------------------------------*/
static void
recv_uc(struct unicast_conn *c, const linkaddr_t *from)
broadcast_recv(struct broadcast_conn *c, const linkaddr_t *from)
{
printf("unicast message received from %d.%d\n",
from->u8[0], from->u8[1]);
printf("*** Received %u bytes from %u:%u: '0x%04u' ", packetbuf_datalen(),
from->u8[0], from->u8[1], *(uint16_t *)packetbuf_dataptr());
printf("%d - %u\n", (int8_t) packetbuf_attr(PACKETBUF_ATTR_RSSI),
packetbuf_attr(PACKETBUF_ATTR_LINK_QUALITY));
leds_toggle(LEDS_GREEN);
}
static const struct unicast_callbacks unicast_callbacks = {recv_uc};
static struct unicast_conn uc;
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(example_unicast_process, ev, data)
static const struct broadcast_callbacks bc_rx = { broadcast_recv };
static struct broadcast_conn bc;
/*---------------------------------------------------------------------------*/
PROCESS(cc1200_demo_process, "cc1200 demo process");
AUTOSTART_PROCESSES(&cc1200_demo_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(cc1200_demo_process, ev, data)
{
PROCESS_EXITHANDLER(unicast_close(&uc);)

PROCESS_EXITHANDLER(broadcast_close(&bc))
PROCESS_BEGIN();

broadcast_open(&bc, BROADCAST_CHANNEL, &bc_rx);

tmp102_init();
linkaddr_t addr;
unicast_open(&uc, 133, &unicast_callbacks);
SENSORS_ACTIVATE(button_sensor);
while(1) {

PROCESS_WAIT_EVENT_UNTIL(ev==sensors_event && data == &button_sensor);
sign = 1;

//PRINTFDEBUG ("Reading Temp...\n");
raw = tmp102_read_temp_raw();

absraw = raw;
if (raw < 0) { // Perform 2C's if sensor returned negative data
absraw = (raw ^ 0xFFFF) + 1;
sign = -1;
}
tempint = (absraw >> 8) * sign;
tempfrac = ((absraw>>4) % 16) * 625; // Info in 1/10000 of degree
minus = ((tempint == 0) & (sign == -1)) ? '-' : ' ' ;
PRINTF ("Current Temp = %c%d.%04d\n", minus, tempint, tempfrac);
etimer_set(&et, LOOP_INTERVAL);



char s[30];
sprintf(s,"Temp is %c%d.%04d\n", minus, tempint, tempfrac);
printf("sending %s\n",s);
packetbuf_copyfrom(s, 30);
addr.u8[0] = RECEIVER;
addr.u8[1] = 0;
unicast_send(&uc, &addr);
while(1) {
PROCESS_YIELD();
if(ev == PROCESS_EVENT_TIMER) {
printf("Broadcast --> %u\n", counter);
leds_toggle(LEDS_RED);
packetbuf_copyfrom(&counter, sizeof(counter));
broadcast_send(&bc);
counter++;
etimer_set(&et, LOOP_INTERVAL);
}
}

PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/**
* @}
*/

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* Copyright (c) 2015, Zolertia - http://www.zolertia.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand All @@ -26,64 +26,36 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
*/

/*---------------------------------------------------------------------------*/
/**
* \addtogroup zoul-examples
* @{
*
* \defgroup remote-cc1200-demo RE-Mote CC1200 RF transceiver test
*
* Demonstrates the use of the TI CC1200 RF transceiver on Sub-1GHz
* @{
*
* \file
* Best-effort single-hop unicast example
* Configuration file for the cc1200 demo
*
* \author
* Adam Dunkels <[email protected]>
* Antonio Lignan <[email protected]>
*/
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_

#include "contiki.h"
#include "net/rime/rime.h"

#include "dev/button-sensor.h"
#undef NETSTACK_CONF_RADIO
#define NETSTACK_CONF_RADIO cc1200_driver
#define NETSTACK_CONF_RDC nullrdc_driver
#define CC1200_CONF_USE_GPIO2 0
#define CC1200_CONF_USE_RX_WATCHDOG 0
#define ANTENNA_SW_SELECT_DEF_CONF ANTENNA_SW_SELECT_SUBGHZ

#include "dev/leds.h"
#endif /* PROJECT_CONF_H_ */

#include <stdio.h>

/*---------------------------------------------------------------------------*/
PROCESS(example_unicast_process, "Example unicast");
AUTOSTART_PROCESSES(&example_unicast_process);
/*---------------------------------------------------------------------------*/
static void
recv_uc(struct unicast_conn *c, const linkaddr_t *from)
{
printf("unicast message received from %d.%d\n",
from->u8[0], from->u8[1]);
}
static const struct unicast_callbacks unicast_callbacks = {recv_uc};
static struct unicast_conn uc;
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(example_unicast_process, ev, data)
{
PROCESS_EXITHANDLER(unicast_close(&uc);)

PROCESS_BEGIN();

unicast_open(&uc, 199, &unicast_callbacks);

while(1) {
static struct etimer et;
linkaddr_t addr;

etimer_set(&et, CLOCK_SECOND);

PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));

//packetbuf_copyfrom("Enric Here!", 12);
//addr.u8[0] = 200;
//addr.u8[1] = 0;
//if(!linkaddr_cmp(&addr, &linkaddr_node_addr)) {
//unicast_send(&uc, &addr);
//}

}

PROCESS_END();
}
/*---------------------------------------------------------------------------*/
/**
* @}
* @}
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Re-Mote + Node Red README
RE-Mote + Node Red README
========================

A very basic example of how to use MQTT-Demo + Mosquitto + Node Red
Expand All @@ -10,9 +10,9 @@ Install Mosquitto

Fire up a Re-Mote
-----------------
* Compile the MQTT demo example from `../../cc2538dk/mqtt-demo.c` following
* Compile the MQTT demo example from `../../../cc2538dk/mqtt-demo.c` following
the instructions of the README.md therein.
* Program your Re-Mote.
* Program your RE-Mote.
* If you are running mosquitto with `-v`, a few seconds later you should see
the Re-Mote connect, subscribe and start publishing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @{
*
* \file
* Project specific configuration defines for the basic Re-Mote examples
* Project specific configuration defines for the basic RE-Mote examples
*/
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
Expand Down
Loading

0 comments on commit 27fd1a5

Please sign in to comment.