Quantcast
Viewing all articles
Browse latest Browse all 40524

[ error ] ofSerial: writeByte(): serial not inited

Hi.

it might help to turn on verbose logging:
ofSetLogLevel(OF_LOG_VERBOSE);

you can print out a list of your serial devices like this:
serial.listDevices();

last but not least, you can check what serial.setup()returns:
if (!serial.setup("/dev/tty.usbmodem411", 115200)) {OF_EXIT_APP(0);}

setup() could look like this:

void ofApp::setup(){
     ofSetLogLevel(OF_LOG_VERBOSE);
     if(!serial.setup("/dev/tty.usbmodem411", 115200)) {
          // log and error and leave
          ofLogError() << "could not open serial port - listing serial devices";
          serial.listDevices();
          OF_EXIT_APP(0);
     }
}

does the serial example (examples/communication/serialExample) work?


Viewing all articles
Browse latest Browse all 40524

Trending Articles