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
9881 Discussions

Problem accessing ttyMFD1 in Java

HLiu36
Beginner
1,050 Views

Hello,

I'm having the following problem and hoping to get some help here:

I'm running a java program (Openhab,see www.openhab.org) on Edison using weekly-159.devkit-2.0 image and java version "1.8.0_72". The openhab program can access USB serial port (e.g., /dev/ttyUSB0) just fine. However, it can not open /dev/ttyMDF1.

I have tried the tricks here ( ) to open the UART port and can indeed write/receive data from ttyMDF1 from console. However, the Java program still can not open the port. Any suggestions?

3 Replies
Carlos_M_Intel
Employee
136 Views

Hi Ted,

I would like to know which jdk version are you using and how are you installing it. I'm assuming you are compiling the code in the board with javac, is this right?

I checked the Openhab.org website but I was unable to find the example you are using, could you post the direct link of the code? Or can you add it in a .txt file?

Are you getting error messages? If you do please post them.

Let us know as much information you can so we could replicate your environment.

Regards,

Charlie

HLiu36
Beginner
136 Views

Thanks! I downloaded jdf from Java.com (ver 1.8.0_72). The openhab program (runtime core) was downloaded from here: http://www.openhab.org/getting-started/downloads.html openHAB - Getting Started - Downloads

I then installed the serial binding (like an addon) following the instruction here: https://github.com/openhab/openhab/wiki/Serial-Binding https://github.com/openhab/openhab/wiki/Serial-Binding In my particular case, I created an item file (test.items) in the /configurations/items folder; it has the following line:

String Arduino "Arduino" { serial="/dev/ttyMFD1@115200" }

The serial binding recognizes a usb-based serial device (/dev/ttyUSB0, which connects to an arduino nano) just fine, but can not use /dev/ttyMFD1. The error message is something like the following:

"2016-02-23 13:48:54.570 [ERROR] [i.internal.GenericItemProvider] - Binding configuration of type 'serial' of item ?Arduino? could not be parsed correctly.

org.openhab.model.item.binding.BindingConfigParseException: Could not open serial port /dev/ttyMFD1: Serial port '/dev/ttyMFD1' could not be found. Available ports are:"

Thanks again and let me know if you need any other information!

Edit: I think I may have figured out the problem. It appears that openhab requires explicit reference of "uncommon" serial port in the command line. Now the program can open the port.

Carlos_M_Intel
Employee
136 Views

Hi Ted,

I'm glad to know that you have been able to use the port with Java on your board.

Regards,

Charlie

Reply