Hello,
currently I'm playing around on a home-automation project.
I tried to let do a nano the following jobs:
- Read one DHT22 Sensor
- Read three DS18B20 Sensors
- Read analog Sensor
- Check incomming UDP messages
- Send sensor values via UDP
- Send debug messages via Serial
- Let a watchdog run
Currently I have chosen the EtherCard Library with an ENC28J60.
The good Message: It works fine as long as i do not use the EtherCard Library AND the OneWire Libary at the same time. (Each one works fine, as long as I do not use both). If both are in use the system will freeze during the loop(), watchdog does not init a rebeoot. My only explanation is that I'm overloading the system (CPU or RAM).
I do not use TCP or DHCP since this protocols/services are not hardware implemented within the ENC28J60.
I currently see following options to solve the problem (Not sure if it is possible to get each of them to work);
- Find a Library for ENC28J60 which can implement UDP Server and Client and which uses less resources (is there any)?
- Use the W5100 with the default Ethernet library instead of ENC28J60 (does the lib use less resources)?
- Use an AtTiny85 for the 1-Wire sensors and send the values via some kind of serial communication to the nano
- Use analog temperature sensors, not use 1-wire lib (easiest way, but not prefered, because the sensors have to be adjusted manually)
- Not use the EtherCard Library on nano. Send values serial to a second nano which sends via EtherCard Lib to UDP (Serial > Ethernet/UDP Gatway)
Which approach would you suggest? Thanks for your feedback!