Arduino-serial-processing-pachube

Hey,

I have already used SimpleAnalogFirmata to send analog values from Arduino to processing to Pachube but now I am wondering how would I send values in Arduino (not coming from analog input) over the serial port from Arduino to Processing and then use these values and send them to Pachube.

My Processing Sketch is as follows:

import processing.serial.;
import cc.arduino.
;
import eeml.;
import pachuino.
;

Pachuino p;
Arduino arduino;

void setup(){
p = new Pachuino(this, Arduino.list()[0], 115200);
p.manualUpdate(“http://www.pachube.com/api/feeds/****.xml”);
p.setKey("***********");

// local sensors
p.addLocalSensor(“analog”, 0,“Light Sensor Inside”);
p.addLocalSensor(“analog”, 1,“Light Sensor Outside”);
}

void draw(){
//p.debug();
//p.digitalWrite(ledPin, Arduino.HIGH);
//delay(1500);
}

// you don’t need to change any of these

void onReceiveEEML(DataIn d){
p.updateRemoteSensors(d);
}

How do I change this code so that it:
(a) Retrieves values from serial port?
(b) Sends the values to pachube?

Any help would be greatly appreciated, thanks.

Dear Alan, I have the same questions...have you got anything yet?

I can send values from Arduino via serial and print them in Processing but can’t send them to Pachube.

Just Serial.print in the Arduino sketch and the following is the processing code to receive the printed value (in case you want it):

import processing.serial.*;

Serial myPort; // The serial port
//int xPos = 1; // horizontal position of the graph

void setup () {
// set the window size:
//size(400, 300);

// List all the available serial ports
println(Serial.list());

myPort = new Serial(this, Serial.list()[0], 9600);

}
void draw () {

}

void serialEvent (Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil(’\n’);

if (inString != null) {

println(inString);

}
}

If we could somehow combine this with the processing code that sends the firmata values (above) then we may be able to send the value received from Arduino. If you get any further please let me know.

Alan

Hey Alan, have you succeeded with this yet?
Would like to send data from Processing to Pachube myself.
/fatzo

Hi,

I think this link can be interesting:

http://community.pachube.com/arduino/usb/processing

I don't know anything about this but I wanted to help a little by surfing the internet :slight_smile:

Hope this can help,

retxed68

Thanks retxed68, that's exactly what I'm looking for.
I hope to test this in a couple of days, will let you know how it goes.

Cheers, fatzo