- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Tags:
- Internet of Things
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is some example SPI code using MRAA. Please let me know if this helps :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try compiling this one instead. https://github.com/intel-iot-devkit/mraa/blob/master/examples/spi_mcp4261.c ;
note on line 35:
spi = mraa_spi_init(0); |
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I still get the same error.
I want to use my xbee module. I need serial communication using Tx & Rx. Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did this ever get an answer?
I'd like to use a BT radio module on pins 0 &1 with XDK (IoT edition), and all the node.js examples are for analog and digital pins.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page