Environmental monitoring applications require adept networking strategies and reliable communications to ensure the integrity of their most fundamental operations including the sensing duties, network-node interactions, and system resiliency to unpredictable events. In this paper, we propose a fire emergency and gas detection system based on WSNs for both indoor and outdoor environments. The challenges which are addressed in this paper include: management of nodes, provision of algorithms, risk modeling and analysis, and Over-The-Air-Programming (OTAP).