IoT systems use sensors to collect data from smart environments and manage resources through data analysis. An IoT system deals with many connected devices with different network and hardware constraints in a real-world scenario. An IoT system needs to handle low-latency data analysis, security threats, internal vulnerabilities, and network disconnections, which cause data loss and incorrect decisions. Trustworthiness (also known as dependability) provides various features for an IoT end-to-end data flow, such as resilience, security, availability, reliability, scalability, maintainability, heterogeneity, hardware resources management, fault management policies, and data quality. This paper presents a survey on trustworthiness and dependability in IoT systems and proposes the Trustworthiness for IoT Framework (TW-IoT) to provide trustworthiness at the data level for mist and fog-based IoT systems. The TW-IoT framework provides data trustworthiness to ensure a continuous and uninterrupted operation of IoT data flow. We also discuss challenges and trade-offs related to data trustworthiness in IoT.