Resource discovery is a significant feature in the Internet of Things (IoT) environment as the number of resources increases. As several resources are added every day, the complexity of managing these resources increases. Resource discovery has a key role in finding all active resources in a certain area to allow users to become aware of the surrounding resources and access available resources. This paper proposes a resource discovery approach based on an updated Constrained Application Protocol (CoAP) and neural network. The proposed approach presents a discovery of active and faulty resources. It gives the opportunity to find faulty resources and apply fault-tolerant methods. For smart areas, it is significant to track all resources and ensure they are not faulty. This process is performed using a neural network for fault classification, and the neural network runs computations in the cloud. The proposed method also provides the location of resources, either active or faulty, based on the coordinates of each resource. Furthermore, users are divided into four groups according to the permission of each group for getting a list of resources, getting metadata, and accessing resources. The proposed method is tested as a CoAP client (user) deployed on a mobile phone and CoAP server is deployed on Rasberry Pi using resources of Wemo switch, Printer, and TI SensorTag. The experimental results show the proposed method has a discovery success rate of more than 98%. The results show the proposed method has comparable results in terms of latency, energy consumption, and traffic load.