Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quickstart.rst #29

Closed
wants to merge 1 commit into from
Closed

Conversation

bettabacon
Copy link

Note will not work for 10.6.8. Perhaps include a note for all plaformio that command will not succeed. Perhaps an issue with Python. Not sure why darwin_i386 when should be something darwin_i686 or something 64-bit.

Note will not work for 10.6.8. Perhaps include a note for all plaformio that command will not succeed. Perhaps an issue with Python. Not sure why darwin_i386 when should be something darwin_i686 or something 64-bit.
@bettabacon
Copy link
Author

Just tell me if this request/note should be included earlier. I only bumped into it in this document, so making the stop-loss here.

@ivankravets
Copy link
Member

Thanks a lot for your report! 👍

Can you try again to install atmelavr platform? Tell me please if it works for you.

@bettabacon
Copy link
Author

Sure, here's my command and result:

`$ sudo /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio install atmelavr

Password:

Installing toolchain-atmelavr package:

Downloading [####################################] 100%

Unpacking [####################################] 100%

Installing tool-avrdude package:

Error: The package 'tool-avrdude' is not available for your system 'darwin_i386'`

@ivankravets
Copy link
Member

Sorry, I've just fixed manifest file for tool-avrdude package. Try gain. Thanks a lot for the help, because I don't have that configuration for test!

@bettabacon
Copy link
Author

Win! No please, I should be thanking you! :)
$ sudo /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio install atmelavr
Installing toolchain-atmelavr package:
Already installed
Installing tool-avrdude package:
Downloading [####################################] 100%
Unpacking [####################################] 100%
Installing framework-arduinoavr package:
Downloading [####################################] 100%
Unpacking [####################################] 100%
The platform 'atmelavr' has been successfully installed!

@ivankravets
Copy link
Member

Sounds good! 👍

  1. Why do you use platformio command with sudo access? PlatformIO doesn't require sudo access for own operations. sudo is required only for "install/upgrade" PlatformIO in the some machines. If it doesn't work without sudo - please report me!
  2. Can you try to compile any project via platformio run? I want to be sure that those installed packages work correctly under your OS.

@bettabacon
Copy link
Author

I think it started because I needed the following:
sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/ivankravets/platformio/master/scripts/get-platformio.py)"
then maybe sudo /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pip install --egg scons
finally without trying anything else, I used sudo /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio install atmelavr
Yes, probably shouldn't have done the last one, but the first two, as I faintly remember, needed it.
Also just a note, my system with MacPorts doesn't have pip nor platformio in its path. Perhaps it might be in the path automatically with fink or brew, but not for MacPorts (port), unless I'm doing something wrong with my set up. I am using Mac OS X 10.6.8
I will try platformio run in a bit. I'm new to Arduino as well, but I can manage the blink program for sure and post back results.

@ivankravets
Copy link
Member

Just open your Terminal and type without sudo those commands:

$ which pip
$ which platformio

Post the results here. Thanks.

@ivankravets
Copy link
Member

I will try platformio run in a bit. I'm new to Arduino as well, but I can manage the blink program for sure and post back results.

Please look into example:
https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink

@bettabacon
Copy link
Author

$ which pip
$ which platformio
yield no results. As I mentioned, they aren't in my path statement, yet
-rwxr-xr-x 1 root wheel 291 Nov 29 14:58 pip
-rwxr-xr-x 1 root wheel 403 Nov 29 14:58 platformio

Maybe interesting...
$ which python
/opt/local/bin/python

$ ls -l /opt/local/bin/python
lrwxr-xr-x 1 root admin 24 Oct 4 23:25 /opt/local/bin/python -> /opt/local/bin/python2.7

I will try with platformio as per link you provided, but must run as full path ATM /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio run

First, I must configure my system to use Chinese serial chip as this is an Arduino copy using WinChipHead not FTDI, then I come back to the above :-/

@bettabacon
Copy link
Author

$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio run
Error: Not a PlatformIO project. Useplatformio initcommand

$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio init
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/__main__.py", line 64, in main
cli()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 610, in __call__
return self.main(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 590, in main
rv = self.invoke(ctx)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 416, in invoke
return callback(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/commands/init.py", line 21, in cli
makedirs(d)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: 'lib'

@bettabacon
Copy link
Author

I got it. I changed to a user-writable directory. Previously, I was in a user-executable directory:
drwxr-xr-x 2 root wheel 1700 Nov 29 15:08 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin

Here's the output from
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio init
Project has been initialized!
Please put your source code tosrcdirectory, external libraries toliband setup environments inplatformio.inifile.
Then process project withplatformio runcommand.

This was quite messy though. It installed a ./lib, ./src, and platformio.ini without asking me where. I'll move these directories and setup file elsewhere, and try to get
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio run to work

@ivankravets
Copy link
Member

This was quite messy though. It installed a ./lib, ./src, and platformio.ini without asking me where. I'll move these directories and setup file elsewhere, and try to get

platformio init command initialises empty project within the current folder where you are stayed. See details here http://docs.platformio.ikravets.com/en/latest/userguide/cmd_init.html

Do you have any propositions how to improve the behaviour of this command? I have the next propositions:

  1. Add additional argument to this command platformio init %path_to_project_dir%
  2. When that argument is not specified, then show a warning message that PlatformIO is going to create ./lib, ./src and platformio.ini in the current "shell" directory.

What do you think?

@bettabacon
Copy link
Author

Good proposal. I like.

@bettabacon
Copy link
Author

I have an Arduino Uno clone
$ pwd
/Users/someuser/Downloads/platformio/examples/atmelavr-native-blink

$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/platformio run
Processing arduino_pro5v environment:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/__main__.py", line 64, in main
cli()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 610, in __call__
return self.main(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 590, in main
rv = self.invoke(ctx)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 416, in invoke
return callback(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/commands/run.py", line 60, in cli
result = p.run(variables, envtargets)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/platforms/base.py", line 110, in run
] + variables + targets)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/platformio/util.py", line 95, in exec_command
p = Popen(args, stdout=PIPE, stderr=PIPE, shell=use_shell)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

@ivankravets
Copy link
Member

Good proposal. I like.

Thanks! I've just created new issue #31

@ivankravets
Copy link
Member

OSError: [Errno 2] No such file or directory

I don't understand how PlatformIO should work in your environment. Physically, PlatformIO consists from 2 parts:

  • GUI, different managers (Libraries, Packages and etc)
  • Code Builder

The source code builder is based on great project named SCons. If you use recommended way ("Super-Quick" or "Installer Script") to install PlatformIO, then you shouldn't have the similar problems.

I understand, that you used recommended way, I saw your quote in the main report message. It's great! All software which PlatformIO needs is installed in your Mac. But the main problem, that you don't want to allow PlatformIO to use that software. PlatformIO doesn't see it, because that isn't in your $PATH.

PlatformIO requires scons tool for platformio run command. This tool isn't visible from your ENV to PlatformIO. I recommended add to your $PATH that:

export PATH="/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"

Or even, add that line to ~/.bash_profile file. The platformio and scons tools will be visible after Terminal close/reopen.

Please report me which way you will choose! 😄

@ivankravets
Copy link
Member

@bettabacon Can I close this pull request? Do you have any problems with PlatformIO?

Thanks a lot!

@ivankravets
Copy link
Member

Please open new issue if you have problems with PlatformIO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants