gepd / Stino

A Sublime Text Plugin for Arduino
Other
33 stars 10 forks source link

Upload (& Compile) #5

Closed TakeMatsu closed 9 years ago

TakeMatsu commented 9 years ago

I am working on Mac OS10.10.3, Sublime Text 2 2.0.2, Arduino 1.6.5 and stino (v2015.7.6)

I am trying to use stino to compile and upload to an Arduino Uno. Initially I had an issue compiling (it didnt). After some digging online I found a work around. Replacing the exec_cmd in the arduino_compiler.py with the following seemed to work.

def exec_cmds(working_dir, cmds, message_queue, is_verbose=False):
    error_occured = False
    for cmd in cmds:
        return_code, stdout, stderr = exec_cmd(working_dir, cmd)
        if is_verbose:
            message_queue.put(cmd + '\n')
            if stdout:
                message_queue.put(stdout + '\n')
        if stderr:
            message_queue.put(stderr + '\n')
        if return_code != 0:
            message_queue.put(
                '[Stino - Exit with error code {0}.]\\n', return_code)
            error_occured = True
            break
    return error_occured

I am however still unable to upload. I see the [Stino - Done uploading.] message but nothing happens. Checking the Sublime Text 2 console revealed this:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 337, in run_
  File "./StinoStarter.py", line 162, in run
  File "./stino/main.py", line 197, in open_sketch
AttributeError: 'Window' object has no attribute 'project_data'

this seems to be the problem but I have no idea how to fix it. Any ideas?

gepd commented 9 years ago

it's weird, what was your error before to replace exec_cmd ?

TakeMatsu commented 9 years ago

Sorry I was wrong! it wasn't exec_cmds, it was exec_cmd. stino was compiling fine, without changing anything… i think …now i'm confused. Anyway I restored the arduino_compiler.py to the original but I still get the same error message when I try to upload.

sansil commented 9 years ago

Same Problem TakeMatsu! I can't upload the code to my arduino board. I'm using OSX 10.10.3. Thank you in advance!

TakeMatsu commented 9 years ago

I had an old version of Java (Java8 update 45), and after running the update I don't get the AtributeError anymore, but it still doesn't upload…

TakeMatsu commented 9 years ago

This compiling issue has been discussed before. #271 #274 #275. I edited the exec_cmd in arduino_compiler.py (relaunch ST2) as suggested in #271 and this solved the compiling problem. However, the upload on the other hand, seems like is working, no error code and says "Done uploading" but the Arduino is not flashed. There was a work around using an older arduino IDE but this didn't work for me… I thought the issue might be that uploader is not finding some command, but all the commands seem to be pointing right… For now I decided to use the "Use external editor" in the Arduino IDE (which prevents editing in the arduino IDE). So I edit the code in ST2 switch to Arduino and upload.

gepd commented 9 years ago

I've been merge a fix based on https://github.com/Robot-Will/Stino/issues/271 please download and test it.

TakeMatsu commented 9 years ago

It worked, thank you!!