# Connect an Arduino to Mathematica: cannot open port

**URL:** <https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745>\
**Category:** Questions\
**Tags:** mathematica, external-interfaces, interface-construction, connected-devices\
**Created:** [December 11, 2016, 11:27pm UTC](https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745 "2016-12-11T23:27:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![airomoscanu](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@airomoscanu](https://community.wolfram.com/u/airomoscanu)\
**Post date:** [December 11, 2016, 11:27pm UTC](https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745/1 "2016-12-11T23:27:32Z")

</div>

Hi all

Trying to connect an Arduino to Mathematica, and noticing I have Mathematca 10.20 and Arduino IDE 1.6.3 installed, I tried to use the built-in Mathematica Arduino driver mentioned at the top of this thread.

For some reason I’m not able to identify, I can’t have it working. Arduino - **a Mega 2560** - is well on COM4 and functional…but Mathematica won’t open the port:

```
arduinodata = DeviceOpen["Arduino", "COM4,"];

```

results in:

```
Get::noopen: Cannot open GeneralUtilities`. >>
Needs::nocont: Context GeneralUtilities` was not created when Needs was evaluated. >>
Get::noopen: Cannot open GeneralUtilitiesLoader`. >>
StringExpression::invld: Element GeneralUtilities`Seq[] is not a valid string or pattern element in GeneralUtilities`Seq[]. >>
StringExpression::invld: Element GeneralUtilities`Seq[] is not a valid string or pattern element in GeneralUtilities`Seq[]. >>
SerialLink`SerialPortOpen::nopen: Could not open the port COM4,.

```

Note that I am using an **Arduino Mega 256** 0! So not an Uno, nor an Yun. Could this be it?

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [December 12, 2016, 12:09am UTC](https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745/2 "2016-12-12T00:09:39Z")

</div>

Welcome to Wolfram Community! Next time please do not spam discussions unrelated directly to your question: ask a separate question. Please read the rules: [http://wolfr.am/READ-1ST](http://wolfr.am/READ-1ST)

---

<div class="post-metadata">

**Author:** ![ijohnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ijohnson/32/21468_2.png) [@ijohnson](https://community.wolfram.com/u/ijohnson)\
**Post date:** [December 13, 2016, 10:32pm UTC](https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745/3 "2016-12-13T22:32:24Z")

</div>

Hello,

Yes, you are correct in that the Arduino Mega is not supported, only the Yun and the Uno are supported.

Thanks,  
Ian

---

<div class="post-metadata">

**Author:** ![airomoscanu](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@airomoscanu](https://community.wolfram.com/u/airomoscanu)\
**Post date:** [January 11, 2017, 9:30am UTC](https://community.wolfram.com/t/connect-an-arduino-to-mathematica-cannot-open-port/9745/4 "2017-01-11T09:30:03Z")

</div>

Thank you Ian.
