Answers.Body: <p>Bluetooth communication from the Mac to the EV3 is done using <a href="https://en.wikipedia.org/wiki/List_of_Bluetooth_protocols#Radio_frequency_communication_.28RFCOMM.29" rel="nofollow noreferrer">RFCOMM</a>. This means that the EV3 appears as a serial port on the Mac. Namely <code>/dev/tty.EV3-SerialPort</code>. To send and receive messages from the EV3, you read and write to this virtual file. Bluetooth will show as "connected" as soon as you open this file. You can find some code examples <a href="https://bricks.stackexchange.com/questions/4256/cant-send-multiple-commands-to-ev3-using-python">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-11T22:42:57.437Z
Answers.Text: Thank you for your response, David.  Actually, with Thiago's comment I found that though the Mac preferences said the EV3 was disconnected, when I tried to send a message (play a tone) using the serial port (using Python), it connected and worked!  I appreciate the examples here.  They've been of great help.
Answers.UserDisplayName: Aakaash Vaasan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-13T00:09:13.247Z
Answers.Text: Now that I've tested the Bluetooth connection, I'm trying to read a .rtf text file on the brick using Python.  I'm using opFile with open_read, read_value and close all packaged into one direct command (DIRECT_COMMAND_REPLY).  Now, since I'm using Python file write to write this direct command to the Bluetooth serial port, how do I get the value returned (the text value in the .rtf file) by the direct command?  Python file write does not have a return value.
Answers.UserDisplayName: Aakaash Vaasan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-10T23:30:06.390Z
Answers.LastActivityDate: 2015-12-10T23:30:06.390Z
Answers.LastEditDate: 2017-04-13T12:47:56.390Z
Answers.UserDisplayName: David Lechner
Body: <p>I am trying to connect the EV3 brick over Bluetooth to a Mac so I can use direct commands to send bytecodes.  However, the Bluetooth connection remains active only through the Lego Mindstorms software.  I can download programs from Mac over Bluetooth within the Lego Mindstorms software.  However, once I close that app the bluetooth connection goes away.  Without the Lego software open, if I try pairing EV3 to Mac, it pairs briefly and stays connected (according to Mac's preferences menu) for 2 seconds and then says "Not connected".  I am using Macbook Pro early 2014 with Yosemite.  I also upgraded the firmware on EV3 to 1.08. Please help.</p>
  
Tags: <ev3><bluetooth><mac>
Title: Connecting EV3 to Mac over Bluetooth without Lego Mindstorms software
UserDisplayName: Aakaash Vaasan
ThreadText: # Connecting EV3 to Mac over Bluetooth without Lego Mindstorms software
  
  (Asked by: username_0 on 2015-12-10)
  
  I am trying to connect the EV3 brick over Bluetooth to a Mac so I can use direct commands to send bytecodes. However, the Bluetooth connection remains active only through the Lego Mindstorms software. I can download programs from Mac over Bluetooth within the Lego Mindstorms software. However, once I close that app the bluetooth connection goes away. Without the Lego software open, if I try pairing EV3 to Mac, it pairs briefly and stays connected (according to Mac's preferences menu) for 2 seconds and then says "Not connected". I am using Macbook Pro early 2014 with Yosemite. I also upgraded the firmware on EV3 to 1.08. Please help.
  
  **Tags:** ev3, bluetooth, mac
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-10. Score: 2 | Accepted answer
  
  Bluetooth communication from the Mac to the EV3 is done using [RFCOMM](https://en.wikipedia.org/wiki/List_of_Bluetooth_protocols#Radio_frequency_communication_.28RFCOMM.29). This means that the EV3 appears as a serial port on the Mac. Namely `/dev/tty.EV3-SerialPort`. To send and receive messages from the EV3, you read and write to this virtual file. Bluetooth will show as "connected" as soon as you open this file. You can find some code examples [here](https://bricks.stackexchange.com/questions/4256/cant-send-multiple-commands-to-ev3-using-python).
  
  > **Comments:**
  > **username_0**: Thank you for your response, username_1.  Actually, with Thiago's comment I found that though the Mac preferences said the EV3 was disconnected, when I tried to send a message (play a tone) using the serial port (using Python), it connected and worked!  I appreciate the examples here.  They've been of great help.  
  > **username_0**: Now that I've tested the Bluetooth connection, I'm trying to read a .rtf text file on the brick using Python.  I'm using opFile with open_read, read_value and close all packaged into one direct command (DIRECT_COMMAND_REPLY).  Now, since I'm using Python file write to write this direct command to the Bluetooth serial port, how do I get the value returned (the text value in the .rtf file) by the direct command?  Python file write does not have a return value.  
  
  ---
  
  