1, Infrastructure for communication debugging
No matter which device is being debugged, Which protocol should be used, Communication debuggingBottom level toolsAlways a necessity——Serial assistant sends and receives raw data, Local area network scanning discovers devices, Bluetooth search for nearby devices, Network diagnosis and troubleshooting of connectivity issues. These 4 tools are the foundation of all debugging work.
Two, Serial port debugging tool
Serial port debugging is the responsibility of all embedded/industrial control engineersDaily tools.
2.1 Multiple ways of connection
- USBConvert to serial port: ThroughOTGWire connectionUSBTurnTTL/RS232/RS485Module to mobile phone
- Bluetooth serial port: Connect the Bluetooth serial port module (LikeHC-05/HC-06/BT-04) , Wireless serial port debugging
- WiFiSerial port: connectWiFiSerial server (LikeUSR-W610) , TCPTransparent transmission to serial port
2.2 Parameter configuration
| Parameters | Optional values | Modbus RTUTypical values |
|---|---|---|
| Baud rate | 1200-921600 bps | 9600/19200 |
| Data bits | 5/6/7/8 | 8 |
| Checksum | None/Even/Odd/Mark/Space | None/Even |
| Stop position | 1/1.5/2 | 1 |
2.3 Core functions
- Hex/ASCIIDual mode: HexMode displays hexadecimal bytes (fitModbus) , ASCIIDisplay readable text in the mode (fitGPS, ATInstructions, etc)
- Automatic sending: Set time intervals (100ms-60s) , Automatically send specified content in a loop——Used for aging testing and stress testing
- Timestamp: Automatically attach a timestamp before sending and receiving data (Accurate to milliseconds) , Facilitating the analysis of communication timing
- Sending history: Automatically save the most recently sent files100A command, Click to reuse
- ModbusFrame recognition: According to3.5Character spacing (Modbus RTUstandard) , Automatically segment the received data into frames of messages
- CRC/LRCverification: Automatically detect the tail of the messageCRC16OrLRCVerification, Mark the verification results
Three, LANIPScanner
LAN scanning is for network debuggingThe first step——Connect the internet cable but do not know the deviceIP, Nothing can be discussed.
3.1 Scanning mode
- IPQuick scanning of segments: Enter network segment (Like192.168.1.0/24) , ConcurrencyPingAll254An address, List all online hosts within seconds
- SingleIPDeep scanning: Regarding designationIPPerform port scanning (1-65535Custom scope) , Discover open service ports
- ARPScan: ThroughARPDiscovery of LAN devices in the table (Only applicable to the same subnet, unwantedIPReachable)
3.2 Scan results
Display for each discovered device: IPAddress, MACAddress, Host name (NetBIOS/mDNSAnalysis) , Equipment manufacturers (According toMACAddressOUIdistinguish——LikeDell/HP/Siemens/HikvisionWait) , Open port list (Including service name——Like502=Modbus, 80=HTTP, 443=HTTPS, 22=SSH) .
3.3 Auxiliary tools
- Ping: appointIPof TestingPingDisplay latency and packet loss rate, Route tracing
- Display the path of the data packet reaching the destination: TracerouteQuery
- DNSDomain name resolution and reverse resolution: Input
- Wake-on-LAN: Send a network wake-up packet to the addressMACfour
four, BluetoothBLEDebugging tools
BLE (Bluetooth Low Energy) YesSmart home sensorsThe mainstream communication method——Temperature and humidity sensors, Door magnets, Human body sensor, The widespread use of smart locks and other technologiesBLEsignal communication.
4.1 Core functions
- Device scanning: Scan nearbyBLEEquipment, Display device name, MACAddress, Signal strength (RSSI) , Broadcast data
- Broadcast data analysis: AnalysisBLEIn the broadcast packageAD Structure (Manufacturer data, ServiceUUID, Equipment name, etc)
- GATTService browsing: Browse all after connecting the deviceGATT ServiceAndCharacteristic, Read/write/notify operations
- RSSIDistance measurement: Estimate equipment distance based on signal strength (Accuracy is affected by the environment, For reference only)
- Data logs: Automatic recordingBLECommunication data, Sort by timestamp
Five, Network equipment debugging assistant
Comprehensive network diagnostic tool, Integrated:
- Network status: CurrentlyWiFi/Cellular network information (IP/Gateway/DNS/Signal strength)
- Connectivity testing: PingTarget device, Statistics of latency/packet loss
- Port testing: TCPConnection testing specifiedIP:Port, Confirm that the port is reachable
- HTTPTesting: GET/POSTRequest testing, View response status codes andBody
- Modbus TCPTesting: One click testingModbus TCPEquipment (502Port) The connectivity of
- Network packet capture: Simple packet capture analysis (Include source/targetIP, Port, Protocol type)
Six, Summary
4Communication basic debugging tool, From the serial port signal at the physical layer to the application layerHTTPRequest, Covering the full stack requirements for communication debugging. They are the foundation of all upper layer protocol debugging tools.
Open WeChat search modbusDebugging Assistant ", Carry a Swiss Army knife for communication debugging with you.
🎯 All tools described in this article are free to use in WeChat mini programs
Open WeChat → Click on the top search button → Input modbusDebugging Assistant " → Enter the mini program.
No need to downloadAPP, No registration or login required, No need for a computer——70+ Industrial control debugging tool, Just take out your phone and you can use it.
Whether you are on the construction site, During business trips, Still studying at home, modbusDebugging assistants are all industrial automation debugging workstations that you carry with you.
Leave a Reply