Go Down

Topic: Arduino + rasPberryPI+ Ardulink + eHealth (Read 187 times) previous topic - next topic



I'm new on arduino and raspberrypi world and need some help with this.

I have this configuration:

-RaspberryPI 2


-Configuration of Ardulink into raspberry LINK

-Arduino software installed into raspberry

-This is a code compiled and launched from raspberrypi

Code: [Select]
#include <eHealth.h>

// The setup routine runs once when you press reset:
void setup() {

// The loop routine runs over and over again forever:
void loop() {

  float ECG = eHealth.getECG();

  Serial.print("ECG value :  ");
  Serial.print(ECG, 2);
  Serial.print(" V");

  delay(1); // wait for a millisecond

And this is java class wich uses Ardulink

Code: [Select]
import org.zu.ardulink.Link;
import org.zu.ardulink.RawDataListener;
import org.zu.ardulink.event.ConnectionEvent;
import org.zu.ardulink.event.ConnectionListener;
import org.zu.ardulink.event.DigitalReadChangeEvent;
import org.zu.ardulink.event.DigitalReadChangeListener;
import org.zu.ardulink.event.DisconnectionEvent;

public class Main {

    private final static String COMPORT = "/dev/ttyS80";
    private final static int BAUDRATE = 115200;
    private static Link link;
public static void main(String[] args) {



public static void connect(){
link = Link.getDefaultInstance();

link.addConnectionListener(new ConnectionListener() {

        public void disconnected(DisconnectionEvent e) {
        System.out.println("Error connect");

        public void connected(ConnectionEvent e) {
        System.out.println("Connect succesful");
        try {
} catch (InterruptedException e1) {
// TODO Auto-generated catch block

link.connect(COMPORT, BAUDRATE);


public static void startListenStatus(){

link.addDigitalReadChangeListener(new DigitalReadChangeListener() {

public void stateChanged(DigitalReadChangeEvent e) {
// do something
System.out.println("STATECHANGED: " + e.getIncomingMessage());

public int getPinListening() {
return 11;

link.addRawDataListener(new RawDataListener() {

public void parseInput(String id, int numBytes, int[] message) {

System.out.println("ParseInput: ");
        StringBuilder build = new StringBuilder(numBytes + 1);
        for (int i = 0; i < numBytes; i++) {
            build.append((char) message[i]);
        String msgString = build.toString();
        if (msgString.startsWith("SERIAL")) {
            msgString = msgString.substring("SERIAL".length());
            // print data to console
            int dataNewPoint = Integer.parseInt(msgString);
            // add new data point to the real time chart



Sensor eHealth is connect to arduino and arduino is connected to raspberrypi through usb cable.

The problem is that I not get any messages in console when launch java program.

Thanks for all

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:


You need confirm that the port on your RPi is what you have in your program is in fact;
Code: [Select]
private final static String COMPORT = "/dev/ttyS80";If you are using generic code, the port may well be different for your setup.

Oh, and welcome to the forum, the Arduino forum that is  :)

Go Up