Reputation: 9
I am testing er-rest-example with Zolertia Z1 in Contiki with Cooja, I want too know if with this platform light sensor and temperature sensor are emulated, because only .wll-know/core, test/hello, test/push, actuators/toogle, and sensors/battery has been activated.
In platform-conf.h, PLATFORM_HAS_LIGHT and PLATFORM_HAS_SHT11 are not present, I want to know why? And how I could test it in Cooja as with the Sky mote?
Upvotes: 0
Views: 1013
Reputation: 8537
PLATFORM_HAS_LIGHT
and PLATFORM_HAS_SHT11
are not present in Zolertia Z1's configuration file because the Z1 platform does not have onboard light and humidity (SHT) sensors.
One can attach light sensor and SHT sensors to it by using the Phidgets interface, but it would unreasonable to expect that everything that can be attached to a node is by default simulated in Cooja.
However, it's possible to simulate these sensors in Cooja with some (not very big) additional effort. The Phidgets Contiki driver .c file is in contiki/platform/z1/dev/phidgets.c
. There you can see that, essentially, to access a phidget sensor the node just reads an ADC channel. ADC channel reading is already implemented in Cooja/MSPsim. The only problem is that Cooja/MSPsim will give out random (or zero) values by default when an ADC channel is read. To change these values to realistic sensor readings you need to implement a custom Java class, as described in this answer.
Upvotes: 1