Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9867 Discussions

How enable UART pins Edison Board

ARami9
Novice
2,905 Views

Hello,

I'n new to the Edison world. I'm trying to write a hex value to the serial port and then waiting for the response. However apparently it is necessary to configure those pins first. Found some info on this forum on how to enable the Tx,Rx UART pins in the Edison board by writing shell scripts. I'm using the XDK, how can I do that from the XDK? It's possible? ...or how to do that? It's necessary to do that when using the Edison on the Arduino expansion board?

Thanks in advance!

27 Replies
MGilm
New Contributor I
205 Views

The settings like baudrate, parity, stop bits - but especially baudrate can cause a bad decode. Try hacking around with those.

ARami9
Novice
205 Views

Hello,

After a lot of testing, I think, I've diagnosed the problem. Thing is, NodeJS Serialport library's .write() method is not sending any value equal or greater than decimal 128. My code looks like this (simplified):

serialPort.write(new Buffer([0xF4, 0x57, 0x00, 0x01, 0xB4]), function(err, results),,,

Meaning the car PCM expects value 0xF4 then 0x57 then 0x00 the 0x01 then 0xB4 to respond with a stream of 63 bytes of sensor values, however all it receives is:

# W# (replace the # with this): a rombus with a question mark inside. Every number greater than or equal to 128 decimal gets replaced by that symbol. Nor the zero or the 1 are either sent, so the car PCM understands nothing about what the Edison is trying to say and responds nothing. Tested connecting the Edison to a FTDI serial to USB cable back to the laptop and receiving the Edison values with XDK's own serial terminal, using PUTTY and a NodeJS program that wrote to read the serial port, all displaying the same results.

So finally the question is how to actually get all values sent? ...in javascript, 'cause need to use Firebase library to send values from sensors to the cloud.

Your help will be very much appreciated.

Alfredo.

MGilm
New Contributor I
112 Views

I'm a bit uncertain what you are witnessing/reporting...

You say "all it receives is:" But what physical device is actually displaying this rhombus for you to see?

It looks to me like what ever it is, it's trying to interpret the hex values as ASCII. A 0x57 is a W in ASCII. So that appears fine.

But, the 0xF4 and 0x00 etc., cannot be rendered generally.

Can you switch the view to "Hex"?

>>"Tested connecting the Edison to a FTDI serial to USB cable back to the laptop and receiving the Edison values with XDK's own serial terminal, using PUTTY and a NodeJS program that wrote to read the serial port, all displaying the same results"

"Same" as in you are seeing the rhombus?

OR "same" as seeing what you are expecting?

Mike

ARami9
Novice
112 Views

Hello,

>>"But what physical device is actually displaying this rhombus for you to see?"

 

A Laptop. I'm using the XDK to program the Edison, then wired the UART back to the Laptop via a FTDI serial to USB board, then reading the values with the PUTTY terminal, the XDK itself in the "Terminal tab" or a NodeJS program that wrote to check. All display the rhombus.

My feeling is same as yours. The laptop encodes the USB binary data back to ASCII to render on the screen. The Buffer object does accept encoding. Tried again specifying 'hex', 'utf8' or 'binary' (new Buffer(0xF4,0x57,0x00,0x01,0xB4), 'hex') and the laptop keeps receiving rhombus, W, rhombus which like you said, it's fine. Now all what's required is hook up back into the car PCM and perform some trial and error testing to check if the car responds or read the Edison outgoing UART data with anything else other than the PC and check for the actual binary data being sent (better more efficient approach)..

Thank you! Will come back with results.

Alfredo.

MGilm
New Contributor I
112 Views

OK, as long as you understand that issue - it can send folks new to the com port world into the weeds!

It would be good as you proceed to figure out how to see the hex.

I read this elsewhere...In PuTTY:

  • Session | Logging
  • Select All session output, then select save file.
  • After saving the file, use any hex editor to see the result.

Still, there are com port interfaces that show hex natively. I'd have to dig to find one. And they may not be free. :-(

ARami9
Novice
112 Views

You're right Mike-SYR. Well a logic analizer with PC capture software is in the mail right now, so I think that will definitely help to see what's going out from that Tx pin!

asss
Valued Contributor II
112 Views

Hi Hungrymind,

I guess it is possible to short Rx and Tx of the serial port with a wire

and check that NodeJS with Serialport library sends and receives the same data.

Have you tried to do this?

BR,

xbolshe

Reply