1
$\begingroup$

I have a device which communicates with the computer through serial. The device waits until it receives the character 'a', and then begins to stream data. I have been able to connect to the device and test it in PuTTY, where hitting 'a' will begin the stream and I can read the data just fine in terminal.

Now I would like to work with this data in Mathematica. Working in a notebook, it looks like I can properly open the device. However, attempting to write to it gives me a rather cryptic error--especially when I know this works in PuTTY.

This is the strange error I get.

If anyone can help me to make sense of this, that would be fantastic.

$\endgroup$
2
$\begingroup$

Assuming, from the syntax, that you are on a Windows PC.

I can't remember where I saw this, but i had similar issue with my Arduino and resolved it by referring to the port in the following manner:

    dev = DeviceOpen["Serial", "\\.\\COM11"];
    DeviceWrite[dev, 1];
    (* Code to read the data stream... *)
    DeviceClose[dev];

Please note the whacky syntax for defining the COM port. That's only for windows. The Mac's will use the Unix syntax like in this example.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.