Garbage data on Serial Port

Thread Starter

Anuj Mattoo

Joined Jun 26, 2016
6
Hi

I have readymade working electronic product. I am applying reverse engineering on it. The WiFi module is connected to microcontroller via UART( RX & TX). The android app sends command to wifi and microcontroller works as per the command. I have attached a USB to TTL cable on RX and TX also command ground as well of WiFi module. The cable is connected to serial monitor on PC. When the app send data to WiFi, the serial monitor shows garbage value, which is not readable. I have checked every baud rate possible. Instead of USB to TTL cable, I also used HC05 bluetooth module. But it shows garbage value. How can I get the readable values on my serial monitor. Do i need to disconnect micro controller from WiFi??

Please help
 

Papabravo

Joined Feb 24, 2006
21,228
Baudrate is not the only source of problems. You also have to worry about databits {7,8}, parity {ODD, EVEN, NONE}, and stopbits {1, 2}. If some device is using a nonstandard baudrate without the prime factors 2,3, and 5 then that is also a problem. Aschematic block diagram of your setup might also be helpful. I for one cannot follow your verbal description of your setup.
 

Thread Starter

Anuj Mattoo

Joined Jun 26, 2016
6
Yes, there can be various factors. I can explain you the flow diagram. The 8051 Microcontroller is connected to WiFi module via UART. The android app sends some values, like ON/OFF led, PWM values..etc to WiFi Module via HTTP protocol. I just want to decode what exactly app is sending to WiFi module. For that, I connected a USB to serial cable to RX & TX of WiFi module. When I press something on App, the serial monitor shows some odd symbols, but those symbols doesn't change randomly. They do occur repeatedly, if same function is performed on app i.e the values are constant for the functions on app. Every function has specific odd looking symbols. What to do? I can attach the WiFi module datasheet with this post.

Baudrate is not the only source of problems. You also have to worry about databits {7,8}, parity {ODD, EVEN, NONE}, and stopbits {1, 2}. If some device is using a nonstandard baudrate without the prime factors 2,3, and 5 then that is also a problem. Aschematic block diagram of your setup might also be helpful. I for one cannot follow your verbal description of your setup.
 

Attachments

shteii01

Joined Feb 19, 2010
4,644
Yes, there can be various factors. I can explain you the flow diagram. The 8051 Microcontroller is connected to WiFi module via UART. The android app sends some values, like ON/OFF led, PWM values..etc to WiFi Module via HTTP protocol. I just want to decode what exactly app is sending to WiFi module. For that, I connected a USB to serial cable to RX & TX of WiFi module. When I press something on App, the serial monitor shows some odd symbols, but those symbols doesn't change randomly. They do occur repeatedly, if same function is performed on app i.e the values are constant for the functions on app. Every function has specific odd looking symbols. What to do? I can attach the WiFi module datasheet with this post.
So. Android device (phone/tablet/whatever) uses wifi to send data to wifi module. Wifi module is connected to pc? using usb cable.

What is the point of having 8051 connected to the wifi module?
 

Thread Starter

Anuj Mattoo

Joined Jun 26, 2016
6
The 8051 controls the whole electronic part, like Leds, motors. It is an IoT product. So the function of WiFi Module is to receive the command from app and send to controller via UART. For decoding purpose I connected the USB to serial cable to WiFi Module, to see what data it sends. But unfortunately the serial monitor shows some Indecipherable data on serial monitor.


So. Android device (phone/tablet/whatever) uses wifi to send data to wifi module. Wifi module is connected to pc? using usb cable.

What is the point of having 8051 connected to the wifi module?
 

Thread Starter

Anuj Mattoo

Joined Jun 26, 2016
6
Yes, I am pretty sure. I have checked the connections. I just checked every possible Baud rate from 4800 to 115200.

I have attached the screenshot as well (Converted to Hex as well) . The 0D part is enter command. The first two images has similar data but with different baud rate. First image data is set at 4800 and second one at 9600 with No parity, 8 bit data, stop bit 1. "0D" is just enter command( For readability).
 

Attachments

Last edited:

Papabravo

Joined Feb 24, 2006
21,228
Yes, there can be various factors. I can explain you the flow diagram. The 8051 Microcontroller is connected to WiFi module via UART. The android app sends some values, like ON/OFF led, PWM values..etc to WiFi Module via HTTP protocol. I just want to decode what exactly app is sending to WiFi module. For that, I connected a USB to serial cable to RX & TX of WiFi module. When I press something on App, the serial monitor shows some odd symbols, but those symbols doesn't change randomly. They do occur repeatedly, if same function is performed on app i.e the values are constant for the functions on app. Every function has specific odd looking symbols. What to do? I can attach the WiFi module datasheet with this post.
You don't get it do you? I'm not the only one that can't figure out from your WRITTEN description WTF you are doing. Make a freaking diagram -- what's the problem??
 

NorthGuy

Joined Jun 28, 2014
611
I just checked every possible Baud rate from 4800 to 115200.
You don't need to guess the baud rate. You just look at the signal with a scope or with logic analyzer and measure it. It doesn't have to be any pre-defined baud rate. Do you have a datasheet for WiFi module?
 

Sensacell

Joined Jun 19, 2012
3,453
If your terminal gives you a consistent, repeatable output, then your setup is probably working.

What are you expecting the data to look like? maybe it's just simple binary data using non-ASCII codes.
That will look like "Garbage Values" on any terminal- unless you understand what you are looking for.
 

shteii01

Joined Feb 19, 2010
4,644
If your terminal gives you a consistent, repeatable output, then your setup is probably working.

What are you expecting the data to look like? maybe it's just simple binary data using non-ASCII codes.
That will look like "Garbage Values" on any terminal- unless you understand what you are looking for.
I am guessing that it would require reading wifi module datasheet.
 
Top