Trying to reverse an engineer a program that communicates with a device through a COM PORT. From monitoring the program, it sends 4 bytes of 0x00 and then the device replies back with the same and switches to flash mode. When I send the same bytes, the device does not respond, and in fact, no matter what I send, the serial port monitor says 0x00 is being written.
I've tried several different com port monitors, tried several different baud rates, flush com port before sending the command. Nothing seems to work. What could cause this type of issue?
no matter what I send, the serial port monitor says 0x00
From what you describe it seems like the serial sniffer you use is faulty.
Serial port sniffer I'm using successfully is this Serial Analyzer.
Related
I am trying to connect a WiFi module (ESP8266) to a "funduino" development board (Arduino Nano) but I have no success. Since I tried so much schematics I've found on the internet about the connection between them two, I kindly ask here if is anyone who succeed in "pairing" this two devices.
I am asking for the schematic and a functional source code.
Regards
The ESP-01 by default comes with nonOS SDK bootloader that communicated via AT commands, you can find the complete command set from Expressif here. This is designed for an MCU (like Arduino Nano) to use it purely as an WiFi module rather than using it as a stand-alone MCU (for which it will require NodeMCU SDK).
If you ever upload an Arduino sketch up to the ESP-01, it will erase the AT Command firmware.
Assuming your ESP-01 is still having the AT Command firmware. What #Ben provided is a sketch that allows you to type AT commands via the Serial Monitor to internact with the ESP-01, it is manual, and good for testing if ESP-01 is working (you type AT and press return on Serial Monitor, the ESP-01 will ack with Ok) but not practical as a real application. The minimum commands required to established an WiFi connection with ESP-01 is listed below.
AT+CIPMUX=1 - Enable single (0) or multiple connection (1) to the web server.
Multiple connection is a good option if you are repeatedly sending
out or reading data from the Internet.
AT+CWMODE=3 - Set WiFi mode: 1 is station mode (ESP8266 is client), 2 is AP mode
(ESP8266 acts like a WiFi router where your phone or PC can connect),
3 is AP+station mode (make the ESP8266 do both)
AT+CWJAP=“<your-ssid>”,”<your-pw>” - Connect to your WiFi. Provide your SSID name
and password inside the double qoutes.
AT+CIFSR - This returns the IP address of the module, indicating that it has
successfully connected to your WiFi router.
Once the WiFi connection is established, you can further communicate with the ESP-01 via the connection, like accessing a website for example:
AT+CIPSTART=0,"TCP", "www.example.com","80” - Start TCP or UDP connection. The
0 is the id of the connection.
AT+CIPSEND=0,16 - Command to tell the module data is ready to be sent. 0 is the
connection id, and 16 is the length of the data to be sent.
After this command, the ESP8266 will reply with the “>”
character to tell us that it will be waiting for the data to be
sent. If successful, the module will reply with “SEND OK”
GET / HTTP/1.1 - Send the http header, and other data, etc...
You can write your own sketch to automate those AT commands for interacting with with ESP-01 once you understand the AT commands required for establish a WiFi connection.
Here are two resources that I personally found extremely useful for doing more than connecting to WiFi.
STM32-ESP-01 Web Server - although this is for interfacing with STM32, the main difference is the pin assignment, so you should be able to port to Arduino easily.
MQTT via ESP-01
As for hardware interface, please noted that what #Ben provided is correct in principle, but you need to be aware that the ESP-01(ESP8266 to be precise) is a 3V3 MCU, so the connection is depended on what kind of host board you are using. If you are using Arduino Uno/Nano, both are having a 5V MCU, you will need a voltage divider (two resistors to drop the voltage to 3v3 before connecting to ESP-01) or a level shifter chip at least for the ESP-01 Rx pin to avoid the potential damage to the ESP-01.
I have an RFID receiver that constantly sends UDP packets to port 5757. When connected over ethernet to my desktop, all packets are received and valid (confirmed with Wireshark), and there is no issue. When I connect the receiver via ethernet to my laptop, not one UDP packet is received.
Things I have tried:
I have connected the laptop to the desktop over ethernet, and have sent UDP packets via netcat in both directions. Netcat has no issues with sending/receiving the data.
I've also captured and saved the RFID UDP packets on the desktop, and played them back using bittwist, first on the desktop, and had no issues capturing them in Wireshark(desktop). Then I copied the saved packets over to the laptop, played them back using bittwist, and had zero UDP packets captured in Wireshark(laptop).
Finally, I updated the ethernet driver and had the same results.
Any help would be greatly appreciated.
How can i tell if the unit connected to serial port is powered on?
Does serial communication have any means of acknowledging that a command has been received that i can check for?
or is it entirely dependent on whatevers plugged into the serial port?
Most RS232 devices (such as modems) will raise the DSR (data set ready) line when they are powered on and ready to work. You can query the status of this line in software.
In a similar fashion, computers generally raise DTR (data terminal ready) to tell the modem (or whatever device) that they are ready. You can control this line from software.
Acknowledgement is not specified by RS232 and varies from one device to another, but many devices do indeed use hardware handshaking to indicate willingness to receive data. Specifically, they will raise CTS (clear to send) when they are ready. If the device is powered on, but can temporarily not receive data, it will leave DSR high, but will clear CTS.
I am using a EVB for siemens MC45 GSM modem. Itried to send At commands to it via serial port with Hyperterminal in windows (both Xp and 7). But the hyperterminal window is showing that I am connected but when I type something it doesnot show my writings. and no response from the GSM modem is received.
What Can I do ?
The problem is with your hyper terminal settings when you are connecting with the modem.
Use these settings: Baud rate:9600 data bits:8 stop bits:1 parity bits: none flow control:none Should work now. Also check whether you are communicating with the correct port
Have you configured the hyperterminal session properly? I think you will probably need to set it up as follows:
BaudRate 19200
Databit 8
No Parity
Stopbit 1
No Flow control
i have a few devices that communicate through serial port. Since, they are not always connected to the same serial port, so i need to know exactly which device i'm communicating with when i send data. How can I check which device is connected to which com port.
The solution that is most often used is to "ping" each serial port and then check the reply. Program your device to reply with a certain message when it receives a special request, e.g. if it receives "Hello" it will reply "Hi, I'm device X". This way you can send "Hello" to each serial port in sequence, wait a second or so, and if you receive the reply you were expecting, then you know what serial port to use.
This might confuse some devices connected to the serial port though, so you need to consider what kind of devices your users have connected. In most cases, if you pick a keyword that the device is not expecting to receive, it will simply discard of the request you send it and wait for another request.
In some cases rs-232 P'n'P features may be usable