RFID reader port settings - serial-port

I'm using an RFID reader connected to my computer over RS232 to usb port. It is using COM3 port with default settings (9600, 1 stopbit, no parity etc). After scanning a test card it gives me a nonesensical response, something like ··½w»··{íë
I think I tried almost all combinatios of baud rate, parity etc and I'm not getting a "normal" UID reponse. What could be a problem here? I don't know much about RFID and I can only assume that the test cards are ok. How can I find the correct settings? I contacted the supplier but I'm still waiting for a response.
Thanks :)

Related

Reading BLE telegrams on COM ports

I am trying to read BLE telegrams sent to a usb plugged reciever to my PC.
I am using a serial port reader ( used putty at first then tryed some other software from the net). However, I get nothing, not data at all sent; not from my sender not even any telegram from may be other unknowm devices that may be there advertising.
I have run mode on command line to give me information and it shows that my com port has a baudrate of 1200.
I must say this value was not fix it goes from 1200 to 57600.
I know that my data is sent at a baudrate of 57600: so I'm thinking may be the problem is that the baudrates being different it can't get the data but then it should come to a time where I can see at least some insignificant data of incomplete telegram. I have also tried to change the baudrate on the serial com port reader but same result nothing at all.
My question is what might be the problem and how can I fix it ? in other words having a BLE reciever and tranciever how can I read the telegrams on COM ports

Arduino Uno serial monitor printing garbage

I am using an Arduino Uno and GSM sim800l for a project. It looks like something is wrong and I don't know what it is. Here is my code:
#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
Serial.begin(19200);
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(19200);
altSerial.println("Hello World");
}
void loop() {
char c;
altSerial.print("altSerial is working.");
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
Its output was like this:
AltSoftSerial Test Begin (linebreak)
Hello World (linebreak)
ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
I tried changing the baud rate of the code and serial monitor to keep it matched, but it is not working. I tried to lower it as low as 300 and tried up to 19,200 baud as well.
I also tried menu Tools → Fix encoding and reload, but it still didn't solve the problem. It is my first time using this type of hardware, so please bear with me. My goal is to use it to send SMS messages. but right now I'm trying a smaller task with it to try and understand it better.
The Arduino IDE version I am using is 1.8.7.
It is a troubleshooting tree:
I am going to assume the system is Windows 10, but the basic ideas are the same if the way to achieve them are different.
Plug in your Arduino. You already said your serial monitor is set to 19200, but be sure you are sure, because that is very often the problem.
if you are sure of #1, open Control Panel → Device manager → Ports
If you don't see "Ports" in the list, then your computer isn't seeing the Arduino. This could be anything from a bad Arduino to a bad cable to a bad USB port on your PC. Try switching all those out one at a time to see if you can get anything talking to the COM port at speed. Since you were getting something in the serial monitor, this won't be your particular problem.
Click on "Ports" to expand it, and verify you see the Arduino listed. Right click on the Arduino, disable, and enable it again. See if that fixes the baud rate problem.
Look at Arduino properties
Does it say your device is working properly? If no, look at events and you will see an error description. Fix whatever it says is wrong. If yes, continue.
Port settings will likely be 9200, 8, None, 1, None. Even if your baud rate in the serial monitor window is 19200, you will still probably see 9200 in Device Manager, don't worry about it. It feels wrong, but it is normal. Microsoft seems to like keeping 9600 here, even if the last thing I did with this port was different. The data bits, and other settings listed above are a different matter.
next, click on Advanced
is your Arduino-assigned port number showing up? Does it say 'In Use' beside it? If it does, this is your problem. I know. Strange, huh? Trust me, if it says 'In Use', that means that something internal to Microsoft is using the port, but it isn't your Arduino. Power shell can help you resolve what has it, but that's another story, but the best bet now is reinstall your driver.
Click the Driver tab, and verify your Driver Provider is Arduino LLC. I've never seen it not that, but if it isn't, I would try to find out why.
Go ahead and Update the driver and reboot your computer, even if you aren't prompted to reboot, do it anyway.
Didn't fix it? In the Driver tab, Disable the device, and re-enable it. That might fix the problem, too.
Didn't it fix it? Don't uninstall the driver just yet.
Click Details. Do you see Arduino?
Look at the Events tab. If you see an error, then fix it.
Still not working? Uninstall your serial driver, and reinstall it.
Still no 19200? If you have garbage, the timing on your RX pin is not synchronized with the Arduino TX pin. You now need a logic analyzer, and that is more than can be covered here.

Arduino & ESP8266 - strange characters in response

I'm working on an Arduino Uno + ESP8266 project.
I try to use them as a web server on Wi-Fi network to control a motor that connects to Arduino - basically a trigger system that receives signals via Wi-Fi. Currently, I've successfully connected ESP8266 to my access point by sending AT commands from Arduino. Another client on the same network can statically access ESP8266's assigned IP address.
However, when I try to catch some HTTP queries (I want to use them as conditions to control the motor) I occasionally encountered the non-ASCII characters in HTTP request. I use serial comm to debug, please look at the screenshot in the link below:
Arduino - Computer serial communication for debugging
The line ",519:POST ..." should contain a complete number following "/?", but there's some strange characters instead. So I cannot determine the input data to control motor. Once in a blue moon, the expected format of request shows up as follows:
The correct data received
There's no issue with the HTTP response part, even though I got the uninterpretable request, I can still send the JSON error message back to client.
Attempt Note:
The Arduino uses different serial ports to talk to computer and ESP8266. Since the connection can be established, and the data being sent, I believe that the baud rate is simply correct on both side. (115200 for ESP8266, 9600 for computer - also tried 115200 for both and got the same result)
I use V3.3 from Arduino as power source for ESP8266. But I also use voltage regulator to smooth out the current as many people suggest that. The problem still remains.
I'm struggled with this issue for a few days, just want to know if anybody had the similar experience, or could give some clue for the next step.
After a considerable effort to stabilize the circuit, I switched to NodeMCU and got the system working perfectly. I assume that ESP8266 alone is somehow not robust enough without other components, which I unfortunately have no knowledge on.
So I'd like to close this thread with a short recommendation for anybody struggling with the same issue to switch to NodeMCU (which would replace both Arduino and ESP8266); if that could support the requirement.

Understanding serial device settings

Please feel free to slap me and send a link if this question has already been answered; I just couldn't find it. I did search though.
I've been trouble-shooting communication with a serial device. In looking over lots of documentation, I now understand what the settings for "baud rate," "data bits," "stop bit," and "parity" mean. But what I can't seem to understand is who (sender or receiver) determines these settings.
Say I have a serial device plugged into my computer. In my code, I open a connection to the serial port and specify something like 9600,8,E,1. When I specify these settings, do these get sent to the sending itself, so that it knows how to send the data to my receiver? Or is it more common for a sender to expect a receiver to comply with strict settings?
The issue I'm having is that I attempted to use "Even" parity, and that resulted in tons of irregular transfer errors. When I use "Odd" parity, however, those errors go away. There is also a USB to Serial adapter involved in my set up. There aren't any transfer errors with Even or Odd parity without the adapter in the middle. So I'm just having a hard time understanding whether the device itself doesn't support sending with Even parity, or whether the adapter is the thing causing trouble, etc.
Thanks.
When I specify these settings, do these get sent to the sending itself, so that it knows how to send the data to my receiver?
No.
To expand on the comment by Hans Passant, both sides of the serial port have to agree on the settings, otherwise they won't talk to each other. If they don't agree, you will get gibberish data on either side as the hardware will read the data at an incorrect time. The settings are normally documented in the manual for the device that you are attempting to communicate with. For example, to communicate with a Cisco router, you will generally use the following settings:
Bits per sec : 9600
Data bits : 8
Parity : none
Stop bits : 1
Flow control : none
When you setup the serial port on your side, you must use these same settings, there is no hardware-level handshake between the two devices that determines the speed that they will communicate at.
Sometimes, the format for the serial port settings may be given in a format like the following:
9600,8,N,1
Which is just shorthand for the above quote(9600 baud, 8 data bits, no parity, 1 stop bit)
In my experience, most devices default to 9600,8,N,1, the next common serial setting is 115200,8,N,1

Serial communication using USB

I am trying to connect ATmega128 uart to PC using USB-to-RS232 converter so that PC can receive and transmit data from microcontroller using hyper terminal. I set the correct stop bits and baud rate in hyper terminal. It doesn't seem to work.
Can any one tell me if this is possible by USB-to-RS232 converter and if not what other options are there for serial communication between PC and microcontroller ?
You should be able to do this without any issues. I'd suggest putting your USB-to-RS232 cable in loopback mode first (if possible) to ensure you can communicate, then connect it back up to your MCU.
If you aren't seeing what you expect the first thing to look at are the settings, specifically the baud rate. Since your USB-to-RS232 cable is from a third party vendor I'd assume that your settings on the host side are OK. So you should look in to your MCU code to ensure that all your clocks are running at the proper speed and you have indeed performed the correct calculations to achieve your desired baud rate. Debugging here to ensure you are transmitting data out of the device is important.
Additionally, there are tools that can help you debug. Portmon is a tool from Microsoft that lets you look at the serial data path on the host side. I'd also recommend a USB analyzer, such as an Ellisys, that will allow you to view data going across the line from your MCU to the host.

Resources