MrYsLab / s2a_fm

A Scratch Hardware Extension For Arduino
GNU General Public License v3.0
104 stars 64 forks source link

osX, can't detect board. #10

Closed Cyberek closed 9 years ago

Cyberek commented 9 years ago
s2a_fm version 1.5   Copyright(C) 2013-14 Alan Yorinks    All Rights Reserved 

Python Version 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]

PyMata version 2.10  Copyright(C) 2013-15 Alan Yorinks    All rights reserved.

Opening Arduino Serial port /dev/tty.usbmodem1411 

Please wait while Arduino is being detected. This can take up to 30 seconds ...
Board Auto Discovery Failed!, Shutting Down
Traceback (most recent call last):
  File "./s2a_fm.py", line 145, in <module>
    s2a_fm()
  File "./s2a_fm.py", line 80, in s2a_fm
    firmata.analog_mapping_query()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyMata/pymata.py", line 216, in analog_mapping_query
    self._command_handler.send_sysex(self._command_handler.ANALOG_MAPPING_QUERY, None)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyMata/pymata_command_handler.py", line 619, in send_sysex
    self.pymata.transport.write(data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyMata/pymata_serial.py", line 107, in write
    self.arduino.write(data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 490, in write
    if not self._isOpen: raise portNotOpenError
serial.serialutil.SerialException: Attempting to use a port that is not open

Seems I cannot communicate with the board. Using the same tty I can upload code to Arduino via Arduino app.

MrYsLab commented 9 years ago

Do you have either StandardFirmata or FirmataPlus uploaded to the Arduino?

If yes, could you please run this test program and let me know the results.

Here is a sample output of that program:

Please Enter Your Serial Port In Quotes:'/dev/ttyACM0'
Attempting to open /dev/ttyACM0 at 57600
Serial Port /dev/ttyACM0 is open
MrYsLab commented 9 years ago

@Cyberek If the test program is successful, then please show me the command line you are using to start s2a_fm. Thanks.

Cyberek commented 9 years ago
Please Enter Your Serial Port In Quotes:'/dev/tty.usbmodem1411'
Attempting to open /dev/tty.usbmodem1411 at 57600
Serial Port /dev/tty.usbmodem1411 is open

I use this port to communicate via Arduino software.

MrYsLab commented 9 years ago

Good, so we know that pyserial can open your serial port. I don't own a Mac and that is why I am asking you to help me debug your problem.

The next step is to try another simple program that will blink the on-board LED (L13). The program is here. I edited the program to use the serial port you are using, so you just need to run this program and should not need to make any changes to it.

If this program fails, then I would like you remove the USB cable from your computer and then plug it back it. Wait about 10 seconds to allow the board to reset and try running the program again.

If this now works, then I would try removing and replacing the cable again and then try rerunning s2a_fm.

Please let me know the results.

Cyberek commented 9 years ago

I was able I solve the problem... Formata was somehow missing from the board causing all the problems. FirmataPlus works really well with all sensors. Thanks for the support.