4 Replies Latest reply on Jun 15, 2016 12:44 PM by Kyrenny

    mraa UART functionality

    Kyrenny

      I'm trying to use mraa::uart in C++ on my Edison. G++ says all of the functions I use with mraa::uart aren't defined. These are the steps I followed for installing mraa libraries:

      mkdir mraa/build && cd $_

      cmake .. -DBUILDSWIGNODE=OFF

      make

      make install

      When I get to the make step there is no makefile and it fails. Other c++ files using mraa work, just not the uart ones. Attached is a screenshot of the errors received when trying to compile the program. Any help is greatly appreciated.

        • 1. Re: mraa UART functionality
          Romonaga

          please examine the output from the compile. In many of the issues it is simply you passing the wrong type of variable to the function.

           

          For example, you are passing a std::string where an int is required.

          For example, you are passing a std::string where it wants a char array.

           

          If if you are using a std::string and need to pass it as a chat array, simply do .c_str() on your std::string before passing it into the function. 

           

          As as to your problem with the int. You need to look at atoi.   I suspect once you fix your bugs, you will have better luck compiling. Please fix bugs and report back if you still need help.

          • 2. Re: mraa UART functionality
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hi Kirenny,

            Let’s try with the suggestions given by Romonaga, if this doesn’t work I suggest you to contact EmutexLabs due that Ubilinux is their image and they could give you more suggestions regarding this.
            Also, have you tried with the MRAA examples from https://github.com/intel-iot-devkit/mraa/tree/master/examples/c%2B%2B? or are you already using the UART example from there?

            Regards,
            Charlie
             

            • 3. Re: mraa UART functionality
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Kyrenny,

              Have you tried with Romonaga’s suggestions? 
              Let us know if you have tried to contact EmutexLabs or if you tried with the MRAA examples.

              Regards,
              Charlie
               

              • 4. Re: mraa UART functionality
                Kyrenny

                Thanks Romonaga for your suggestions. It turned out that none of these errors were causing the problem. I was following a tutorial which required the use of the "cmake" command. Because I had an out-of-date version of Cmake, this step was not executing fully and thus the MRAA library was never being installed. Updating Cmake allowed the "cmake" command to run all the way through, actually installing MRAA and solving my problem.

                2 of 2 people found this helpful