ATMega1284 and Relative Humidity libraries
Per the library instructions, you will receive INVALID_VALUE in the following situations:

The readXX() functions return:

DHTLIB_OK (0) : if the sensor sample and its checksum is OK.
DHTLIB_ERROR_CHECKSUM (-1) : if the checksum test failed. This means that data was received but may be incorrect.
DHTLIB_ERROR_TIMEOUT (-2) : if a timeout occured, communication failed.

In case of a DHTLIB_ERROR_TIMEOUT, humidity and temperature will both get the value DHTLIB_INVALID_VALUE. In case of DHTLIB_ERROR_CHECKSUM the values of humidity and temperature are left unchanged as it is impossible to determine which byte failed in the checksum. It is up to the programmer to decide what to do. One can compare with previous value, but better reread the sensor.

So read the value returned by the read11() or read22() functions to verify that it's an DHTLIB_ERROR_TIMEOUT condition, and if so try to figure out why the library is having trouble talking to the device.