platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
136 stars 104 forks source link

Programming Arduino Yun over wifi? #23

Open ivankravets opened 7 years ago

ivankravets commented 7 years ago

Moved from https://github.com/platformio/platformio-core/issues/452

/cc @grzegorzshub, @AKBON, @yveshanoulle


Is it possible to program Yun over wifi please?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39755416-programming-arduino-yun-over-wifi?utm_campaign=plugin&utm_content=tracker%2F38207915&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38207915&utm_medium=issues&utm_source=github).
yveshanoulle commented 7 years ago

what does this move mean? Is this being worked on?

ivankravets commented 7 years ago

@yveshanoulle we cleanup PlatformIO Core repository from non-related issues. According this issue it will be automatically resolved with PIO Remote. PIO Remote allows to work with hardware from anywhere in the world. No need to open SSH or etc.

yveshanoulle commented 7 years ago

Not really a solution for me. My devices are running on a private network. I don't want them to connect to the internet.

yveshanoulle commented 7 years ago

I'm sad you don't think this is a core feature. for me it was a core functionality of the arduino editor that I used everytime I uploaded code.

ivankravets commented 7 years ago

@yveshanoulle PlatformIO Core doesn't have any relations to Arduino or other vendors. It is multi-platform, cross-platform and independent ecosystem. The other vendor related things are implemented via "development platform". This is a place where we have discussion now.

PlatformIO is free and open source ecossytem licensed under Apache 2.0. Anyone can improve this Atmel AVR development platform and make PR.

We are focused on the core features for PlatformIO that could be interested for thousands embedded developers not only for Arduino Yun owners.

Here is a docs:

If we have extra free time or a grant for this issue, The PlatformIO Plus Team will implement this issue.

yveshanoulle commented 7 years ago

I understand it's unreleated to any vendor or platform, yet it's also "marketed" as a platform where we can program for arduino . and yes it's a much better editor then the basic arduino editor. I'm happy with that, only you don't offer the features that are needed to work in a production environment with the arduino's. Connecting with usb is not practical in any other setting then a testing or a play environment. In a coderdojo with the kids that is exactly what we do and that is perfect. I understand that for you it's not part of the platform core, yet I want to make sure you understand that the platform remote is not the same as what was existing in the basic arduino environment. It is much more complex yet forcing people to work in an environment with internet and for devices where memory is not scarse.

ivankravets commented 7 years ago
  1. I agree that PIO Remote != the same solution for this issue
  2. I don't force people to work in an environment with internet or even to use PlatformIO
  3. I proposed PIO Remote because it is already implemented and is ready for using.
  4. PIO Remote is safe and works via SSL in Pro plan.

Thanks a lot that you use PlatformIO. We would be thankful if you support us with https://pioplus.com

P.S: Do you use PIO for commercial projects?

yveshanoulle commented 7 years ago

2) As far as I understand PIO remote, the devices have to be connected to the internet. so yes that is forcing me when I want to work with your program to work in a way I don't want to. 3) As I said already multiple times, it's not possible as my arduino does not have enough memory as we speak. 4) I never said it was unsafe. I don't know what this is an answer to. 5) no, I want to use PIO to configure arduino's that will be lighting my house. Nothing commercial. If it was commercial internet would not be a problem. These will be unsupported, left alone arduino's without internet connection.

ivankravets commented 7 years ago

Where did you buy these boards?

yveshanoulle commented 7 years ago

at a local shop. Why?

ivankravets commented 7 years ago

I mean are these boards from Arduino CC or ORG? I'll contact with vendor and ask to help resovle this issue. Thanks.

yveshanoulle commented 7 years ago

thanks http://www.arduino.org/ products/arduino-yun

ivankravets commented 7 years ago

@artynet please take a look at this issue. You need to handle upload_port, if user specifies it to IP/mDNS , need to use OTA uploading. All things should be done in this file https://github.com/platformio/platform-atmelavr/blob/develop/builder/main.py

meelow commented 6 years ago

I am also interested in this feature :-) How do bountys work here?!?

hansipete commented 6 years ago

I was searching for this as well, because I work with the LINKIT SMART DUO and want to upload via SSH.

I could come up with a first working proof of concept. Maybe its useful for some of you.. a bit hacky, but it works.

Add this env to platformio.ini

[env:sshupload]
platform = atmelavr
board = yun
framework = arduino
extra_scripts = sshupload.py
upload_port = mylinkit.local

sshupload.py (sitting next to platformio.ini in your project folder)

Import("env")
import os

address = env.Dump("UPLOAD_PORT").replace('\'', '')

def ssh_upload(target, source, env):
    print "Attempting to upload firmware via SSH to %s" % address
    firmware = str(target[0])
    os.system('scp '+firmware+' root@'+address+':/root/firmware.hex')
    os.system('ssh root@'+address+' run-avrdude /root/firmware.hex')
    exit()

env.AddPreAction("upload", ssh_upload)

Trigger the SSH upload: platformio run --target upload --environment sshupload (You'll need to enter your YUN/LINKIT root password twice, if you didn't shared your SSH keys)

Let me know if it works on ARDUINO YUN as well. Don't have one, but should be similar.

mrcamilletti commented 6 years ago

@hansipete it worked for me but i had to change target[0] with source[0].

hansipete commented 6 years ago

@mrcamilletti cool – good to hear! i remember having also problems with target vs source[0]...

golyalpha commented 6 years ago

Makes me feel like this should be a part of PlatformIO by now.

Meeh1 commented 5 years ago

Great, thank you! Worked for me too. Is there any way to store the root password so I don't have to enter it each time?

mrcamilletti commented 5 years ago

Great, thank you! Worked for me too. Is there any way to store the root password so I don't have to enter it each time?

You can install your ssh key with an 'ssh-copy-id' command and you won't need to type your password. https://www.ssh.com/ssh/copy-id