IoT-3_Mentoring Pertemuan 13
Wireless Sensor Networks Overview
Introduction to Wireless Sensor Networks (WSN)
- The session begins with a brief introduction, mentioning the topic of discussion: Wireless Sensor Networks (WSN).
- The speaker notes that WSN is often encountered in various courses and suggests familiarity among attendees.
Attendance Check
- The speaker initiates an attendance check, confirming the presence of participants.
- Several names are called out, confirming attendance from multiple individuals.
Conceptual Breakdown of WSN
- The speaker explains that "wireless" refers to connectivity without cables, emphasizing the importance of wireless communication in sensor networks.
- Sensors are introduced as devices capable of collecting various parameters, which will be processed by connected systems.
- A distinction is made between using a single microcontroller versus multiple devices for practical implementations in real-world scenarios.
Implementation Plan
- The plan involves creating three devices: two sensors and one actuator. This setup allows for parameter collection and response actions based on collected data.
- A visual representation is provided to illustrate the network structure involving three nodes: two for sensing and one for actuation.
Technical Specifications
- Each node will utilize ESP32 microcontrollers, highlighting their role in facilitating communication within the network.
- Participants are encouraged to ask questions before proceeding further into technical details about publishing and subscribing mechanisms within the network.
Data Handling Mechanisms
- An explanation follows regarding how data will be published and subscribed across different nodes; left-side nodes publish data while right-side nodes subscribe to it.
- Specific functions of each node are outlined: one collects temperature and humidity data while another gathers light intensity measurements.
Actuator Functionality
Integrating Computing and Control in Physical Systems
Importance of Sensors
- The integration of computing and control in physical systems allows for the addition of new functions, enhancing direct interaction.
- Communication between devices is crucial; it enables effective relationships among computational elements.
Functionality of Wireless Sensor Networks (WSN)
- WSN eliminates the need for individual actuators on each device by utilizing a single actuator that responds to parameters from other machines.
- Information sources can vary, providing data in multiple formats such as graphs or simple text based on user needs.
Data Transmission and Processing
- Machines can send various types of data, including images, which enhances the information received by users.
- Different sensors can communicate over long distances without needing direct connections between devices.
Practical Example of Sensor Application
- An example illustrates two devices: one in a garden detecting pests and another at home triggering an alarm when pests are detected.
- The connection between machines relies on sensing techniques that utilize various sensors to monitor environmental conditions like temperature.
Signal Processing and Actuation
- Data from sensors undergoes signal processing before being sent to actuators that perform actions based on processed signals.
- This process repeats continuously while the machine operates, ensuring real-time responsiveness to changing conditions.
Types of Sensors and Their Architecture
- Various sensor types include temperature, pressure, optical, acoustic, and mechanical sensors.
- WSN architecture connects multiple nodes via the internet for data transmission and analysis.
Data Management Techniques
- Collected data can be analyzed or stored for further use through techniques like data mining after being transmitted over the internet.
Questions and Challenges in Implementation
- Participants are encouraged to ask questions about WSN concepts discussed during the session.
Troubleshooting MQTT Connections
- Discussion includes troubleshooting issues with MQTT connections experienced by participants during practical implementations.
Troubleshooting MQTT Connection Issues
Initial Setup and Configuration
- The password and control settings are confirmed to be correct. Adjustments are suggested for the
mq.xconfiguration.
- Discussion on modifying user credentials and MQTT settings, indicating that changes were made previously.
Client ID Considerations
- Emphasis on ensuring unique client IDs to avoid conflicts during implementation; using examples from previous meetings for clarity.
- Clarification that the client ID in the MQTT setup should not match others to prevent confusion in message routing.
Editing Application Settings
- Instructions provided on how to edit application settings within the MQTT interface, highlighting issues with accessing certain features.
- Reminder about maintaining unique identifiers when implementing solutions directly onto devices.
Debugging Steps
- Acknowledgment of potential issues with username and password configurations; further adjustments are being made for verification.
- Mention of lagging issues due to system overload, which has been resolved by clearing unnecessary data.
Understanding Code Functionality
- The speaker expresses a lack of understanding regarding VS Code functionalities related to previous tasks, indicating a need for further clarification.
- Confirmation that sensor values are displaying correctly after troubleshooting steps have been taken.
Activating LED Control
- Discussion on activating an LED through sending data rather than subscribing; clarifying operational requirements for actuators.
- Instructions given on sending specific values (like '1') to turn the LED on, emphasizing correct syntax usage in code.
Final Adjustments and Future Tasks
- Clarification about data types in programming—distinguishing between string and integer types—and its impact on functionality.
Understanding Note Functionality in IoT Systems
Overview of Notes and Their Functions
- The discussion begins with the definition of a "note" as a schematic component, indicating that multiple notes (three W's) will operate simultaneously.
- There is a clarification on the necessity of having at least three notes for effective operation, but due to limitations, only one device was sent.
Role of Each Note
- Each note typically serves a distinct function; for example, one may be dedicated to receiving temperature sensor parameters.
- It is emphasized that while each note should ideally have its own role, it is possible for one note to both subscribe and publish data simultaneously based on specific needs.
Efficiency Concerns
- The speaker raises concerns about efficiency when a single note handles both publishing and subscribing tasks concurrently.
- They suggest that editing code directly can streamline processes rather than relying on dual functionalities within one note.
Computational Needs and Cloud Integration
- High computational demands may necessitate offloading tasks from devices like ESP32 to cloud services due to their limited memory capacity.
- An example is provided where machine learning applications would benefit from cloud computing instead of being processed locally on an ESP32.
Practical Application of Publish/Subscribe Model
- The use case illustrates sending parameters to MQTT (Message Queuing Telemetry Transport), performing computations in the cloud, and then returning results back to the device.
- This model simplifies operations by allowing the ESP32 to focus solely on data transmission while leveraging cloud capabilities for complex processing.
Structuring Code for Multiple Notes
- The conversation shifts towards structuring code effectively among different notes, suggesting dividing responsibilities between publishing and subscribing functions across two notes.
- A practical approach involves designating two notes as publishers and one as a subscriber based on their respective roles in the system.
Troubleshooting Connection Issues
- A participant raises concerns about connection issues with their application not displaying publisher or subscriber data correctly.
- Suggestions are made regarding troubleshooting steps such as checking settings or configurations within the application interface.
Understanding Local vs. Internet MQTT Connections
Local Network Requirements for ESP32
- The ESP32 must be on the same local network as the device it communicates with, such as a laptop, to function properly.
- If using an internet-based service like Wokwi, and the MQTT server is local, they cannot communicate effectively due to network separation.
Server Installation and Access
- Installing an MQTT server locally allows faster communication compared to using free versions hosted online.
- A local server can only be accessed within its own network, limiting its reach but enhancing speed.
Practical Implementation Plans
- There are plans to code and implement data transmission from a real ESP32 device to the MQTT server after a holiday break.
- Participants are encouraged to practice using Wokwi until they can create custom projects independently before moving on to real devices.
Learning and Development Goals
- Students should aim for proficiency in creating client-server setups with MQTT before implementing them in real projects.
- Understanding that uploading code to the ESP32 takes time; mistakes may require starting over from coding rather than just re-uploading.
Project Collaboration and Tools
- A task has been assigned that allows flexibility in tool usage; students can choose between different platforms or tools for their projects.
- Using real devices will earn students additional credit, encouraging hands-on experience with hardware.
Exploring Alternative Platforms
- Discussion about using Node-RED for project development; participants express uncertainty about its capabilities but show interest in exploring it together.
- Node.js was previously installed by participants during earlier sessions, indicating familiarity with this environment for potential project work.
Compatibility of Devices
Understanding the Differences Between ESP32 and ESP8266
Similarities and Differences
- The speaker notes that the ESP32 and ESP8266 are similar in architecture, with differences primarily in pin configuration and internal specifications.
- Many libraries can run on both platforms, although some may only work on one or the other. This indicates a level of compatibility between the two.
- Programming for both devices is largely similar due to their shared C/C++ based language, making it easier for developers familiar with one to adapt to the other.
Hardware Options
- The discussion shifts to hardware options like Raspberry Pi, which can be used alongside Arduino as long as they have WiFi modules for network connectivity.
- Prices for Raspberry Pi vary significantly, with options available around 500,000 IDR (Indonesian Rupiah), indicating affordability compared to other tech devices.
Operating Systems and Versions
- Different versions of Raspberry Pi support various operating systems such as Windows or Ubuntu; however, not all models allow OS changes.
- The speaker mentions that certain versions of Raspberry Pi can install alternative operating systems beyond its default Raspberry OS.
Connecting Microcontrollers: Tips and Troubleshooting
Connecting Multiple Microcontrollers
- Users are encouraged to experiment by connecting multiple microcontrollers together for enhanced functionality and learning opportunities.
Open Floor for Questions
- An invitation is extended for participants to ask questions freely about their experiences or issues encountered while working with these technologies.
Troubleshooting Connection Issues
Steps for Resolving Connectivity Problems
- A participant's connection issue is addressed by checking settings within an application interface, emphasizing user engagement in troubleshooting.
- Instructions are provided on how to navigate through menus in the application console to find connection information necessary for resolving issues.
Finalizing Connections
- Participants are guided on copying connection information from one part of the application interface into another section where it needs to be pasted.
- Emphasis is placed on ensuring that username and password fields are filled correctly before attempting reconnection.
Troubleshooting Server Issues and Task Guidance
Addressing Server Discrepancies
- The speaker emphasizes the importance of ensuring that the server settings are consistent across different platforms (mtt server, sp32, mktt application) to avoid data discrepancies.
- A specific issue is highlighted regarding mismatched usernames and passwords between user input and the esp32 device, suggesting a need for verification.
Importance of Testing Functionality
- Participants are encouraged to test their setups immediately to ensure everything functions correctly; failure to do so may lead to difficulties in completing assigned tasks.
- The speaker stresses that if participants encounter issues at this stage, it will complicate future steps in their projects.
Communication and Support Availability
- Questions about upcoming holiday services are addressed; however, the speaker notes limited availability for quick responses due to work commitments.
- Participants are reassured that they can ask questions throughout the week as they work on their assignments, which have a one-week deadline.
Encouragement for Open Dialogue
- The speaker encourages participants not to hesitate in asking questions about errors or challenges faced during their tasks.
- A light-hearted mention of "THR" (Tugas Hari Raya - Holiday Assignment), indicating a cultural context where students might receive monetary gifts during holidays.
Clarification on Task Requirements
- The speaker invites further questions from participants while humorously referencing common practices among peers regarding financial gifts.
- An explanation is provided regarding task complexity; while it’s manageable due to existing programs, it requires creating multiple distinct schematics rather than just one.
Technical Insights on Programming Tasks
- Discussion shifts towards technical aspects of programming with references made to subscriber loops and connection checks within code structures.
- Clarification is given about using callback functions effectively when handling data reception in programming tasks.
Overview of Upcoming Assignments
- The speaker outlines that upcoming assignments will involve creating three different programs with varying functionalities based on previously established frameworks.
Project Overview and Schematic Design
Introduction to Project Schematics
- The project involves creating three different schematics using ESP32 with various sensors: DHT22 for temperature and humidity, LDR for light detection, and a servo motor for irrigation.
- Each schematic serves a specific function: monitoring temperature/humidity, monitoring light intensity, and acting as an actuator to water plants.
Project Objectives
- The first schematic monitors temperature and humidity using the DHT22 sensor.
- The second schematic monitors light levels with the LDR sensor.
- The third schematic uses a servo to water plants when temperature exceeds 25°C or humidity drops below 60%, while also activating lights if brightness surpasses 800 lux.
Technical Specifications and Implementation Steps
Data Transmission
- Temperature and humidity data will be sent to the MQTT server under the topic "monitoring/sensor/kelembaban".
- Light data will also be transmitted similarly, allowing real-time monitoring of environmental conditions.
Development Process
- Participants are advised to prepare their devices by creating schematics before developing the program code.
- After coding, testing is crucial to ensure outputs meet expectations.
Discussion on Challenges and Clarifications
Addressing Concerns
- A participant raised concerns about managing publish/subscribe mechanisms in MQTT communication; it was confirmed that both require certificates for secure connections.
Encouragement for Participation
- Participants were encouraged to ask questions freely during discussions to avoid confusion while working on their projects.
Final Remarks and Administrative Notes
Task Submission Guidelines
- Participants were reminded about submitting assignments in PDF format rather than Word documents due to file size issues.
Open Floor for Questions
- An open invitation was extended for any further questions related not only to current tasks but also other topics of interest.
Mentoring Session Summary
Attendance and Permission to Join
- The speaker reminds participants about the procedure for requesting permission if they cannot join the session due to other commitments.
Assignment Details
- Participants are informed that assignments are due on April 10, giving them a week to complete it.
- The speaker encourages participants to reach out if they encounter any difficulties with their tasks during this period.
Closing Remarks
- The speaker expresses apologies for any mistakes made throughout the mentoring sessions as they approach the end of their meetings before the holiday.