Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not reading serial data if booting with SBC #27

Open
msadowski opened this issue Oct 21, 2019 · 4 comments
Open

Not reading serial data if booting with SBC #27

msadowski opened this issue Oct 21, 2019 · 4 comments

Comments

@msadowski
Copy link

Hi!

I have a weird issue that I've seen in two separate firmwares for this IMU board. What I'm observing is that if I connect the IMU to my USB port while the SBC is running everything seems to work well - I can read data, and with the default .ino sending a space character stops the stream (1).

If however I have the IMU plugged in to the SBC when I power up the SBC I read the IMU data just fine but I can't send anything to the board (2).

When debugging I was printing the serial available bytes (LOG_PORT.available()) in case 1 as I was sending characters I could see that available() bytes on the log port increased. In case of 2nd configuration the LOG_PORT.available() always returned 0.

Did anyone run into this? Any tips on how to approach this problem?

@msadowski
Copy link
Author

As a follow up test I've tested this with a trivial sketch that reads serial data and sends it back. I can confirm that this issue is also visible in this case:

int incomingByte = 0;    // for incoming serial data

void setup() {
    SerialUSB.begin(9600);    // opens serial port, sets data rate to 9600 bps
}

void loop() {
  // send data only when you receive data:
  if (SerialUSB.available() > 0) {
  
    // read the incoming byte:
    incomingByte = SerialUSB.read();
  
    // say what you got:
    SerialUSB.print((char)incomingByte);
  }
  
}

@santaimpersonator
Copy link
Contributor

What does SBC represent?

I've used the Razor on multiple computers and I've never had an issue retrieving data or controlling it from a serial terminal (emulator) after the computer boots. Have you tried debugging whatever the SBC is?

@msadowski
Copy link
Author

SBC is "Single Board Computer" in this context. Basically any time I was powering the machine with the board already plugged in I was having issues.

@santaimpersonator
Copy link
Contributor

santaimpersonator commented Oct 9, 2020

I have never had any issues with the Razor working on a Raspberry Pi from boot up. However, I have never really been trying to control it through the serial (USB) connection. I was mostly testing it out as a VR headset concept:
https://www.sparkfun.com/news/2882

  • Maybe it is a kernel/application specific issue communicating with the USB device? I have found screen to work consistently, don't forget to check your baud rate... I've seen some emulators display properly at double/quadruple the baud rate.
  • Since you are using an SBC... have you tried just connecting it to the serial pins directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants