Serial1 debug not working


#1

This issue was marked solved.

I have tried the following, flashing from Particle Build.

int led1 = D0; 
int led2 = D7;
int ledx = D1; // which led to blink

void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(ledx, INPUT);
  Serial1.begin(38400);
  Serial1.println("Hello Serial1");
}
void loop() {
  if (digitalRead(ledx) == HIGH) {
    digitalWrite(led1, HIGH);
    Serial1.println("1");
  } else {
    digitalWrite(led2, HIGH);
    Serial1.println("2");
  }
  delay(1000);
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  delay(1000);
}

With two different FTDI cables I get blinking but nothing printed (using screen on a mac).

Given that there had been past issues with Serial1 earlier I’m just checking that this ought to work.


Direct Bluetooth connection from App(No Particle Cloud)
#2

Serial debugging should be working. What cable are you using?


#3

Can you show us your wiring? in the first post i think it just mentioned tx and rx being connected, you need gnd too. and TX on the bluz will go to the RX on the FTDI and RX on the Bluz to TX on the FTDI.

also is your FTDI a 3.3v or 5v? a 5v FTDI for an Arduino could damage the Bluz if there was no resistors used on the RX line.

i have flashed your code and can confirm Serial1 is working on both 1.0.47 and 1.1.47


#4

thx @Hootie81

Good to know that code works.
Yes. I did have tx-rx and rx-tx and gnd-gnd. No resistors which was a bad idea :frowning:
To get a more stable setup I’ve ordered a 3v FTDI.
Hopefully the Bluz will survive the experience.


#5

Do you have a photon or a core? Both can be used to output serial

If you search the particle forums for arduino serial 5v you will find some threads about using resistors to limit the rx voltage when using 5v ftdi


#6

@paul_tanner If you have a Photon (or other 3.3V Arduino clone) you can do this as well: http://docs.bluz.io/tutorials/serial/#photon

It isn’t the most full proof solution, but it should work for simple debugging.


#7

Thx to all for comments and thx to Bluz for not blowing up when I recklessly forgot to check what type of FDTI I was using. The 3.3v FTDI board did the trick. The sparkfun one was available locally so I got that. All working now :slight_smile: