Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:43:44+00:00 2026-06-05T18:43:44+00:00

I am using Ubunt 10.10. I want to communicate with a microcontroller (ATmega328p) using

  • 0

I am using Ubunt 10.10.

I want to communicate with a microcontroller (ATmega328p) using serial through QT, so for testing I have created a dummy application on the microcontroller that reads character from the UART and responds on the serial port (replies) with the same character but in between brackets.

If PC send: a , then PC receives reply [a]

The application is working great, when I am using hyper terminal (GtkTerm) to send the characters from PC, but when I use QT it does not work. I am sending from QT a character on the serial port, and I am waiting to receive a reply on the hyper terminal, but I do not get any reply.

Serial Communication properties: Baud9600, Parity_none, Stop_bits_1, Data_8bits, Flow_control_Off

#include <QtCore/QCoreApplication>
#include <qextserialport.h>

int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);

   const char data[]= "e";
   QextSerialPort * port = new QextSerialPort("/dev/ttyUSB0");

   port->setBaudRate(BAUD9600);
   port->setFlowControl(FLOW_OFF);
   port->setParity(PAR_NONE);
   port->setDataBits(DATA_8);
   port->setStopBits(STOP_1);
   port->setTimeout(0);
   bool res = false;
   res = port->open(QIODevice::ReadWrite | QIODevice::Unbuffered);

   if(res)
   {
       qDebug("Opened");
       qDebug(data);
       int i = port->write(data, sizeof(data));
   }
   else
   {
       qDebug("Failed to connect");
   }

   return a.exec();
}

Any idea what is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:43:46+00:00Added an answer on June 5, 2026 at 6:43 pm

    It’s not working because you open the serial port 2 times ( 1 time in Qt , and an other time with your HyperTerminal ).

    If you want get the reply of your command, you have to it on your Qt program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ubuntu and I have some html pages. I want to host
I have a problem when I want to launch VLC from Apache using PHP.
I'm using Ubuntu 11.04 and Nginx. I want to install phpmyadmin and have access
I have a rails application and I want to start the server automatically whenever
I am using Ubuntu server, and I want to do a wget cron job
I want to use PDT to debug PHP with eclipse. I am using ubuntu
I want to start using memcache with PHP (on Ubuntu 9.10). There are lots
I want to use JNI on Ubuntu 8.10, using Eclipse and gcc (the standard
I want to use a unsigned int32, using gcc 4.3.3 on Ubuntu 9.04. However,
I am using Ubuntu 9.04 I have installed the following package versions: unixodbc and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.