-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
Sniffing Serial Communication with Two TTL to USB Adapters | ||
========================================================== | ||
|
||
Introduction | ||
------------ | ||
Serial communication is a cornerstone in many electronic systems, allowing various devices to communicate over relatively simple connections. In some cases, you may need to intercept or "sniff" this communication to debug or understand the data exchange between two devices. This guide will show you how to use two TTL to USB adapters to sniff serial communication. | ||
|
||
Requirements | ||
------------ | ||
- Two TTL to USB adapters | ||
- Computer with USB ports | ||
- Serial communication software (such as PuTTY or Termite) | ||
- Breadboard and jumper wires | ||
- Target devices communicating via TTL serial | ||
|
||
.. image:: images/setup_diagram.png | ||
:alt: Diagram of the setup | ||
|
||
Steps | ||
----- | ||
Follow these steps to set up your sniffing station: | ||
|
||
1. **Connect the Adapters** | ||
|
||
Connect each TTL to USB adapter to your computer's USB ports. Note the COM port numbers assigned to each adapter by your operating system. You can find this information in the Device Manager on Windows or using the `dmesg` command on Linux. | ||
|
||
.. image:: images/usb_adapters.png | ||
:alt: TTL to USB adapters connected to a computer | ||
|
||
2. **Wire the Adapters to the Target Devices** | ||
|
||
Identify the TX (Transmit) and RX (Receive) pins on your target devices. Typically, these will be marked on the device or in its documentation. | ||
|
||
- Connect the TX pin of the first device to the RX pin of the first TTL adapter. | ||
- Connect the RX pin of the first device to the TX pin of the second TTL adapter. | ||
- Connect the TX pin of the second device to the RX pin of the second TTL adapter. | ||
- Connect the ground (GND) of the target devices to the ground pins of both TTL adapters. | ||
|
||
.. image:: images/wiring_diagram.png | ||
:alt: Wiring diagram for TTL to USB adapters and target devices | ||
|
||
3. **Configure Serial Communication Software** | ||
|
||
Open two instances of your preferred serial communication software. Configure each instance to listen to one of the COM ports assigned to the TTL adapters. Make sure to set the baud rate, data bits, parity, and stop bits according to the specifications of your target devices. | ||
|
||
.. image:: images/serial_software.png | ||
:alt: Screenshot of serial communication software configuration | ||
|
||
4. **Start Sniffing** | ||
|
||
With everything connected and configured, you should start seeing data being transmitted between the target devices in both instances of your serial communication software. One instance will show the data sent from the first device, and the other will show the data sent from the second device. | ||
|
||
.. image:: images/sniffing_data.png | ||
:alt: Data being sniffed in serial communication software | ||
|
||
Troubleshooting | ||
--------------- | ||
- **No Data Displayed**: Check the connections and ensure that the TX and RX pins are correctly wired. Verify the COM port numbers and settings in the serial communication software. | ||
- **Garbled Data**: Ensure that the baud rate and other communication settings match those of the target devices. | ||
- **Intermittent Data**: Check for loose connections and ensure that the ground connections are secure. | ||
|
||
Conclusion | ||
---------- | ||
Using two TTL to USB adapters is an effective way to sniff serial communication between two devices. This method allows you to monitor and debug communication issues, ensuring your systems function as intended. | ||
|
||
.. note:: | ||
|
||
Always ensure you have permission to intercept and monitor communication between devices, especially in production environments or with proprietary hardware. | ||
|
||
.. image:: images/completion.png | ||
:alt: Successful completion of the setup | ||
|
||
By following these steps, you can set up a reliable serial communication sniffing station and gain valuable insights into the data exchange between your devices. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
esphome: | ||
name: haier | ||
platform: ESP8266 | ||
board: d1_mini | ||
|
||
# Set statul led for Wemos D1 mini | ||
status_led: | ||
pin: GPIO2 | ||
|
||
wifi: | ||
ssid: "ASUS88" | ||
password: "3503470936" | ||
|
||
# Enable fallback hotspot (captive portal) in case wifi connection fails | ||
ap: | ||
ssid: "Haier_wifi" | ||
password: "Haier_wifi" | ||
|
||
captive_portal: | ||
|
||
# Enable web server (can be disabled) | ||
web_server: | ||
port: 80 | ||
|
||
time: | ||
- platform: sntp | ||
id: sntp_time | ||
timezone: "Europe/ Moscow" | ||
|
||
# Enable logging | ||
logger: | ||
level: DEBUG | ||
baud_rate: 0 #Important. You can't use serial port | ||
|
||
# Enable Home Assistant API | ||
api: | ||
password: "3503470936" | ||
|
||
ota: | ||
- platform: esphome | ||
password: "3503470936" | ||
|
||
uart: | ||
- baud_rate: 9600 | ||
tx_pin: 1 | ||
rx_pin: 3 | ||
|
||
|
||
climate: | ||
- platform: haier | ||
id: haier_ac | ||
name: "Haier" | ||
alternative_swing_control: false | ||
wifi_signal: true | ||
supported_modes: | ||
- 'OFF' | ||
- HEAT_COOL | ||
- COOL | ||
- HEAT | ||
- DRY | ||
- FAN_ONLY | ||
supported_swing_modes: | ||
- 'OFF' | ||
- VERTICAL | ||
- HORIZONTAL | ||
- BOTH | ||
supported_presets: | ||
- BOOST | ||
- COMFORT | ||
|
||
switch: | ||
- platform: template | ||
id: haier_ac_health_mode | ||
name: Haier SmartAir2 Climate health mode | ||
icon: mdi:leaf | ||
restore_mode: RESTORE_DEFAULT_OFF | ||
lambda: |- | ||
return id(haier_ac).get_health_mode(); | ||
turn_on_action: | ||
climate.haier.health_on: haier_ac | ||
turn_off_action: | ||
climate.haier.health_off: haier_ac | ||
- platform: template | ||
id: haier_ac_display_switch | ||
name: Haier SmartAir2 Climate display | ||
icon: mdi:led-on | ||
entity_category: config | ||
restore_mode: RESTORE_DEFAULT_ON | ||
lambda: |- | ||
return id(haier_ac).get_display_state(); | ||
turn_on_action: | ||
climate.haier.display_on: haier_ac | ||
turn_off_action: | ||
climate.haier.display_off: haier_ac | ||
|
||
mqtt: | ||
broker: 192.168.31.58 | ||
port: 44444 | ||
username: mqtt | ||
password: mqtt |