Community
cancel
Showing results for 
Search instead for 
Did you mean: 
STiet
Novice
2,668 Views

Intel Galileo Gen.1 - XDK - Can't open serial port.

Jump to solution

Hi all,

I create new project based (UART) Serial Read/Write template on XDK, but i have some problems:

 

Case 1, can't open serial port: When i run (or debug) the project is installed on my device, program has been stopped.

Case 2, can open serial port but i can't write (send) data:

Do you have any idea to fix this issue?

 

Thanks all.
Tags (1)
1 Solution
Carlos_M_Intel
Employee
394 Views

Hi,

Did you try with the example above? Please let us know if you have been able to work on this.

Regards,

Charlie

View solution in original post

13 Replies
Sergio_A_Intel
Employee
394 Views

Hi Don'tCareAboutMyName,

So, according to case 2 you've already managed to open the serial port. To send data I'd suggest you to take a look at https://software.intel.com/en-us/node-js-templates-for-intel-xdk-iot-edition# UART_Serial_Read/Write_ IoT - Node.js* templates for the Intel® XDK IoT Edition | Intel® Developer Zone . Try to use this sample code to read and send data. Once you confirm that everything is working properly move on to your code and try again.

Let me know your results.

Sergio

STiet
Novice
394 Views

Hi Sergio,

As my question(# 1), i tried https://software.intel.com/en-us/node-js-templates-for-intel-xdk-iot-edition# UART_Serial_Read/Write_ IoT - Node.js* templates for the Intel® XDK IoT Edition | Intel® Developer Zone many times but data dosen't send. I always recive: err undefined - result 16 as picture that I've attached in case 2.

Thanks for your support,

 

Sang
STiet
Novice
394 Views

Somebody help me?

Sergio_A_Intel
Employee
394 Views

Is that the full code you're using? If you notice at the beginning of the code you'll notice 4 additional lines, make sure to include them:

var mraa = require('mraa');

console.log('MRAA Version: ' + mraa.getVersion());

u = new mraa.Uart(0);

var serialPath = u.getDevicePath();

Also, I noticed in your code you're using

var serialPort = new SerialPort(serialPath, {

Use

var serialPort = new SerialPort("dev/ttyS0", {

instead.

Sergio

STiet
Novice
394 Views

Hi Sergio,

I follow your guide and here's result:

 

 

 

Serial port still not open.

 

Thanks,

Sang

 

 

 

 

Sergio_A_Intel
Employee
394 Views

What image are you using, the eglibc image or the uclibc image? If you're using the eglibc image there's a newer mraa version available. You can see it from http://iotdk.intel.com/repos/1.5/intelgalactic-dev/ intelgalactic-dev/ . Update to the latest mraa version.

echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf

opkg update

opkg upgrade

Run the OnBoard LED Blink template just to make sure the XDK is configured correctly and then go back to test the UART with the suggestions provided.

Let us know your results.

Sergio

STiet
Novice
394 Views

Hi Sergio,

I'm using image iot-devkit-1.5-i586-galileo, download from https://software.intel.com/sites/landingpage/iotdk/board-boot-image.html IoT Download - Board Boot Image

I have updated to the latest mraa version and OnBoard LED Blink template working fine. But serial port still cannot open.

 

Thanks.
Sergio_A_Intel
Employee
394 Views

Is this issue just related to XDK? What happens if you read the serial port directly from console cat /dev/ttyS0? What other device you have connected to the UART, are you sure it is sending values correctly?

Make sure you have everything properly installed https://software.intel.com/en-us/iot/library/galileo-getting-started https://software.intel.com/en-us/iot/library/galileo-getting-started

Sergio

STiet
Novice
394 Views

Hi Sergio,

I think this issue related to module serialport. The latest version of the module seems not good.

Sergio_A_Intel
Employee
394 Views

Take a look at this example https://github.com/intel-iot-devkit/mraa/blob/master/examples/javascript/uart.js mraa/uart.js at master · intel-iot-devkit/mraa · GitHub . Using this example we will prove if there is an issue with the serial port itself or if you have a configuration issue. Remember to configure the baud rate accordingly.

Sergio

NK
New Contributor I
394 Views

Hey guys even I am getting the console.log only upto the mraa version.....After that I am unable to receive the data.And even unable to open the serial port.

Actually I have a remote xbee sending sample values to the xbee connected to the uart0 port of galileo(/dev/ttyS0);

Can anybody help me out as to how to proceed from here ?

Carlos_M_Intel
Employee
395 Views

Hi,

Did you try with the example above? Please let us know if you have been able to work on this.

Regards,

Charlie

View solution in original post

STiet
Novice
394 Views

Hi,

 

The problem has been solved.

 

Thanks,

Sang

Reply