Robot-Will / Stino

A Sublime Text Plugin for Arduino
Other
1.58k stars 249 forks source link

New-Stino try to find WProgram.h instead of Arduino.h on Ubuntu 14.04 #188

Closed tionebrr closed 9 years ago

tionebrr commented 9 years ago

The package loads fine, and I'm able to select the Arduino folder and the sketchbook folder; but the example list shows an asterix in parenthesis for every libraries. LIBNAME(*). The arduino libraries are not found at compilation. Also,

edit: new stino can find the libraries in fact, but is missing something about the Arduino version... see the posts below.

The compiler tries to find WProgram.h instead of Arduino.h.

I'm using Arduino 1.0.5, may this be the problem ? Any ideas ?

gonzoid commented 9 years ago

I can confirm the same result happens on Linux Mint 17 (based on Ubuntu 14.04), but not on Windows 7.

The problem seems to be the test against the string containing Arduino version in stino\pyarduino\arduino_src.py around line 214:

def combine_ino_files(arduino_version, ino_files):
    prototypes = generate_prototypes_from_files(ino_files)
    arduino_include = '#include "Arduino.h"\n'
    if arduino_version < 100:
        arduino_include = '#include "WProgram.h"\n'

When selecting app folder with Select Arduino Application Folder, console shows the following string: Arduino 1:1.0.5+dfsg2-2 is found at /usr/share/arduino.

Ubuntu and other distros maintainers are formatting version number differently, a few of them can be seen here : http://pkgs.org/search/?keyword=arduino

gonzoid commented 9 years ago

A quick and dirty hack is to comment out the last two lines in the snippet I pasted in my previous post (respectively line 217 and 218).

I could then compile the master_reader.ino example which includes the Wire library without errors.

I don't understand exactly the meaning of the (*) suffix. It is displayed likewise in Windows and Mint, after each element of the Import Library menu and after some elements of the Examples menu. It seems to have something to do with the different platform architectures(?).

tionebrr commented 9 years ago

Oh I think I get it now.... The (*) mark may be signaling a read only element of the library. So that was not related to the WProgram.h problem.

Anyway, thanks for the hack Gonzoid, I'll try that right now.

tionebrr commented 9 years ago

Well, it didn't worked for me... The compiler just doesn't launch... No error, nothing.

I don't have the time to dig into the stino script right now so I will stick with the old stino for the moment.

Robot-Will commented 9 years ago

I fixed the error. You can try it. The version text "1:1.0.5+dfsg2-2" is different from the version from Arduino.cc, and this plugin recognized the version as 1, below 100 and it uses WProgram.h. Now it works fine on my Linux Mint 17.

Robot-Will commented 9 years ago

Arduino above 1.5 provides libraries for avr or sam, or both(*).

tionebrr commented 9 years ago

Hello dear develloper ! Thanks a lot for the fix, it's working now. I have a new problem with the upload, I open a new issue for it. This one can be closed :+1: