Hi Philipp,
I created a similar simple data collection app [1]. It uses SAUL with an
MCP9808 temp sensor (JC 42.4 compliant), and of course CoAP. ;-) Start
with the README. Then look for 'saul' in Makefile and in main.c main()
and _run_sensor_loop().
Ken
[1] https://github.com/kb2ma/riot-data-collector
On 3/20/19 1:04 PM, Philipp Blum wrote:
Hi,
I just want to use the DHT11 sensor. I know that RIOT has an
abstraction layer for sensors, which is really nice. My problem is
just: How to use it? I have a server on my device which accepts UDP
packets. The server should read the sensor data on a regular base,
caches them and sends them back when asked. So, simple as that.
Probably I have add the modules for my driver and saul, right? So my
Makefile should look like this
|USEMDOULE += saul |
|USEMODULE += dht |
The dht driver already has confgurations, which I need to override,
since the pins are not correct. Should I just do the following in my
application?
|#undef DHT_PARAM_PIN |
|#define DHT_PARAM_PIN (GPIO_PIN(0, 12)) |
or should I define the DHT_PARAMS? When the setup is done, I probably
just need to use saul itself with:
|const char temp_sensor_name[] = "dht"; phydat_t temp_data; saul_reg_t
* temp_sensor_reg = saul_reg_find_name(temp_sensor_name);
saul_reg_read(temp_sensor_reg, &temp_data); |
right? thanks for the help :)
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users