I would like to communicate with EM7565 using serial port class. Which parameters should be used (baudrate, parity, data and stop bits, … ) ?
Hi @j.wronski,
You can use “115200 8N1” - 115200 baud, 8 data bits, no parity, and 1 stop bit
Please share any concerns you have and help tick Solutions if your question is answered
Thanks
The most important points to note.
- We recommend the use of our GobiSerial and GobiNet drivers vs the open source ones.
- The third port that enumerates from the device is the AT command port i.e. /dev/ttyUSB2 (assuming no other ttyUSB devices were on the system to begin with).
Regards
Matt
Thank you very much
What about handshake ?
Best regards
This is my very simple C application.
using System;
using System.IO.Ports;
class PortDataReceived
{
public static void Main()
{
SerialPort mySerialPort = new SerialPort(“COM4”);
mySerialPort.BaudRate = 115200;
mySerialPort.Parity = Parity.None;
mySerialPort.StopBits = StopBits.One;
mySerialPort.DataBits = 8;
mySerialPort.Handshake = Handshake.None;
mySerialPort.RtsEnable = true;
mySerialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
mySerialPort.Open();
mySerialPort.Write(“AT!HWID”);
Console.WriteLine(“Press any key to continue…”);
Console.WriteLine();
Console.ReadKey();
mySerialPort.Close();
}
private static void DataReceivedHandler(
object sender,
SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
string indata = sp.ReadExisting();
Console.WriteLine(“Data Received:”);
Console.WriteLine(indata);
}
}
According to the documentation I’ll expect to receive hardware version,
but on my screen as see the following
Press any key to continue…
Data Received:
AT!HWID
it looks like as echo of the written text
What I doing wrong ?
I’m working on Windows 10 64-bits
This is my very simple C#application.
using System;
using System.IO.Ports;
class PortDataReceived
{
public static void Main()
{
SerialPort mySerialPort = new SerialPort(“COM4”);
mySerialPort.BaudRate = 115200;
mySerialPort.Parity = Parity.None;
mySerialPort.StopBits = StopBits.One;
mySerialPort.DataBits = 8;
mySerialPort.Handshake = Handshake.None;
mySerialPort.RtsEnable = true;
mySerialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
mySerialPort.Open();
mySerialPort.Write("AT!HWID");
Console.WriteLine("Press any key to continue...");
Console.WriteLine();
Console.ReadKey();
mySerialPort.Close();
}
private static void DataReceivedHandler(
object sender,
SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
string indata = sp.ReadExisting();
Console.WriteLine("Data Received:");
Console.WriteLine(indata);
}
}
According to the documentation I’ll expect to receive hardware version,
but on my screen as see the following
Press any key to continue…
Data Received:
AT!HWID
it looks like an echo of the command text written
What I doing wrong ?
So that’s partially windows programming which I cannot really comment on but assuming the COM port number you have used is right (COM4) then there are a couple of comments.
- The command you want to be sending is at!hwid?, you are missing the ? character.
- The unit will have echo turned on by default i.e it will echo the characters back to you which is probably what you are seeing. It will then send the Revision and then OK, although in your case it will just send ERROR because the command is incorrect.
Regards
Matt
Do you know any person who can help me on windows platform ?
This really isn’t the forum for Windows questions and I don’t really ‘know’ anyone who can do this, you are better off going to a programming forum.
Regards
Matt
Thank you fir your help. All works .