I’m trying to communicate through the /dev/ttyUSB0 on the raspberrypi. I’ve tried using Serial and Serial1 but not getting any data coming through nor can I transmit from. I’ve verified that the com port does work by installing and using “minicom” on the raspberrypi at /dev/ttyUSB0 with a baud of 19200 and default all other settings which I have also set in the code.
Here is my example code:
String dataLine = "Start";
void setup() {
Serial.begin(19200);
Particle.publish("serialdata", dataLine, PUBLIC);
}
void loop() {
// send data only when you receive data:
char c;
int index;
index = 0;
while (Serial.available() > 0) {
// read the incoming byte:
c = Serial.read();
dataLine.setCharAt(index, c);
}
if(index>0){
Particle.publish("serialdata", dataLine, PUBLIC);
}
}
Hi @craigmac, as far as I am aware this is a highly desired feature that is still under development. This has been discussed on this thread previously.
I have also tried to use the serial pins on the gpio with no success in Particle firmware whatsoever.
The default Serial.println to a “virtual serial port” on the Raspberry Pi itself, not external pins. You can view the output of Serial.println with particle-agent serial in a terminal window on the Pi.
As for real UART printing, I know it’s on the top of the wish list for many people. Thanks for your patience.