Hi all,
I'm trying program my Galileo to communicate using serial port.
I found the mraa library, it has the function to initialize serial communication, but couldn't find code to 'serial write and read'. It would be very helpful if you share some basic code for serial communication or give me some direction to program the same.
Thanks in advance.
链接已复制
Thanks Ashish,
I get the following error when i try to compile the code
..\src\6_cpp_upm_i2c_grove_LCD.cpp: In function 'int main()':
i586-poky-linux-g++ "--sysroot=H:\\iotdk-ide-win\\devkit-x86\\sysroots\\i586-poky-linux" -lupm-i2clcd -o 6_cpp_upm_i2c_grove_LCD "src\\6_cpp_upm_i2c_grove_LCD.o"
h:/iotdk-ide-win/devkit-x86/sysroots/i686-pokysdk-mingw32/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/4.8.2/ld.exe: src\6_cpp_upm_i2c_grove_LCD.o: undefined reference to symbol 'mraa_spi_init'
H:\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux/usr/lib/libmraa.so.0: error adding symbols: DSO missing from command line
collect2.exe: error: ld returned 1 exit status
I included mraa.h is there any other header to be included in elipse?
Okay so after some research I believe you are having a linking error. Check to see if the linker is adding MRAA. Just because you add it in the include folder does not mean it gets linked. I was getting the same error as you until I checked the linker and updated it. To update the linker right click your project -> Properties -> C/C++ Build -> Settings -> Cross G++ Linker
This is what my linker looks like:
--sysroot=/Users/ashishdatta/Desktop/iotdk-ide-mac/devkit-x86/sysroots/i586-poky-linux -lupm-i2clcd -lmraa
Hi,
Was an answer ever provided?
I would like to use the serial port on pins 0 and 1 with node.js and mraa (XDK IoT Edition).
Is this supported as I want to send data out over BT radio modules?
Thanks.
Which board are you using?
If you are using Intel® Edison board, please refer this discussion to enable PIN0 and PIN1 for UART usage and for Bluetooth you can read this user guide for help.
Please feel free to post here if u need any help.
