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

Include tools needed to upload arduino firmware straight from raspi #23

Open
CptanPanic opened this Issue May 17, 2014 · 20 comments

Comments

Projects
None yet
7 participants
@CptanPanic

CptanPanic commented May 17, 2014

It would be nice if I could upload a firmware to the arduino 3d printer controller straight from the raspberry pi. I have downloaded "ino" but doesn't seem to work out of the box. Maybe someone could help get this working.

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft May 19, 2014

Owner

This should be directed to OctoPrint issue tracker. aka @foosel
https://github.com/foosel/OctoPrint/issues?state=open

Owner

guysoft commented May 19, 2014

This should be directed to OctoPrint issue tracker. aka @foosel
https://github.com/foosel/OctoPrint/issues?state=open

@guysoft guysoft added the enhancement label May 19, 2014

@guysoft guysoft changed the title from Feature Request: Include tools needed to upload arduino firmware straight from raspi to Include tools needed to upload arduino firmware straight from raspi May 19, 2014

@CptanPanic

This comment has been minimized.

Show comment
Hide comment
@CptanPanic

CptanPanic May 19, 2014

I don't think this is really a octoprint issue, since this would have to be specific to at least linux and not multiplatform like octoprint. And I don't think we would need to make it part of octoprint gui, but just a command line tool to flash from raspberry pi.

CptanPanic commented May 19, 2014

I don't think this is really a octoprint issue, since this would have to be specific to at least linux and not multiplatform like octoprint. And I don't think we would need to make it part of octoprint gui, but just a command line tool to flash from raspberry pi.

@nophead

This comment has been minimized.

Show comment
Hide comment
@nophead

nophead May 20, 2014

I just install the Arduino IDE on the RPI and remote desktop it with TightVNC. A bit slow and clunky but it works. It should be possible to just use avrdude but Arduino hides the command parameters it uses. That could be simply run as a command from a user defined system menu item.

nophead commented May 20, 2014

I just install the Arduino IDE on the RPI and remote desktop it with TightVNC. A bit slow and clunky but it works. It should be possible to just use avrdude but Arduino hides the command parameters it uses. That could be simply run as a command from a user defined system menu item.

@CptanPanic

This comment has been minimized.

Show comment
Hide comment
@CptanPanic

CptanPanic May 25, 2014

So I just uploaded a new Marlin via the command line and here is how I did it

sudo pip install ino
sudo apt-get install arduino
cd Marlin-Marlin-v1
ln -s Marlin src
ino build -m mega2560
ino upload -p /dev/ttyACM0 -m mega2560

CptanPanic commented May 25, 2014

So I just uploaded a new Marlin via the command line and here is how I did it

sudo pip install ino
sudo apt-get install arduino
cd Marlin-Marlin-v1
ln -s Marlin src
ino build -m mega2560
ino upload -p /dev/ttyACM0 -m mega2560
@nophead

This comment has been minimized.

Show comment
Hide comment
@nophead

nophead May 25, 2014

Great thanks, that's better than using the IDE but it took me about half a day to get it working! The version of ino that pip installs doesn't scan the hardware directory for alternative boards.txt files. I had to get the latest source for it to work with a Melzi by passing -m atmega1284.

I then had the problem that ino insists that all the libraries mentioned in the source exist and tries to compile them, even if they are not actually used due to conditionals. Some libraries (U8glib and Robot_Control) would not compile, so I had to remove them and remove the includes of them in Marlin.cpp. Also when adding or removing a library you have to delete the .build directory or ino uses pickled out of date information.

nophead commented May 25, 2014

Great thanks, that's better than using the IDE but it took me about half a day to get it working! The version of ino that pip installs doesn't scan the hardware directory for alternative boards.txt files. I had to get the latest source for it to work with a Melzi by passing -m atmega1284.

I then had the problem that ino insists that all the libraries mentioned in the source exist and tries to compile them, even if they are not actually used due to conditionals. Some libraries (U8glib and Robot_Control) would not compile, so I had to remove them and remove the includes of them in Marlin.cpp. Also when adding or removing a library you have to delete the .build directory or ino uses pickled out of date information.

@CptanPanic

This comment has been minimized.

Show comment
Hide comment
@CptanPanic

CptanPanic May 26, 2014

The only thing I had to modify of the source was the Marlin.ino file, which was to comment out the stuff in ULTRA_LCD ifdef. Not sure why the conditionals are not being detected correctly.

CptanPanic commented May 26, 2014

The only thing I had to modify of the source was the Marlin.ino file, which was to comment out the stuff in ULTRA_LCD ifdef. Not sure why the conditionals are not being detected correctly.

@rooiejoris

This comment has been minimized.

Show comment
Hide comment
@rooiejoris

rooiejoris Aug 17, 2014

I do have a .hex file, is it then more simple to upload via command line...?! being not a linux expert at all...

[this would save me a lot of time updating 5 boards for the z-unlimited installation running at the moment on www.stapvandeolifantaf.nl ...]

cheers \ joris

rooiejoris commented Aug 17, 2014

I do have a .hex file, is it then more simple to upload via command line...?! being not a linux expert at all...

[this would save me a lot of time updating 5 boards for the z-unlimited installation running at the moment on www.stapvandeolifantaf.nl ...]

cheers \ joris

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Aug 18, 2014

Owner

@rooiejoris are you also using mega2560 like @CptanPanic ?

Owner

guysoft commented Aug 18, 2014

@rooiejoris are you also using mega2560 like @CptanPanic ?

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Aug 18, 2014

Owner

Also what does ino upload -p /dev/ttyACM0 -m mega2560 do?

Owner

guysoft commented Aug 18, 2014

Also what does ino upload -p /dev/ttyACM0 -m mega2560 do?

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Aug 18, 2014

Owner

I pushed a build script to test..

Owner

guysoft commented Aug 18, 2014

I pushed a build script to test..

@rooiejoris

This comment has been minimized.

Show comment
Hide comment
@rooiejoris

rooiejoris Aug 18, 2014

I use mega2560, don't know if it is like @CptanPanic

cheers \ joris

On Mon, Aug 18, 2014 at 1:45 PM, Guy Sheffer notifications@github.com
wrote:

@rooiejoris https://github.com/rooiejoris are you also using mega2560
like @CptanPanic https://github.com/CptanPanic ?

Reply to this email directly or view it on GitHub
#23 (comment).

rooiejoris commented Aug 18, 2014

I use mega2560, don't know if it is like @CptanPanic

cheers \ joris

On Mon, Aug 18, 2014 at 1:45 PM, Guy Sheffer notifications@github.com
wrote:

@rooiejoris https://github.com/rooiejoris are you also using mega2560
like @CptanPanic https://github.com/CptanPanic ?

Reply to this email directly or view it on GitHub
#23 (comment).

@rooiejoris

This comment has been minimized.

Show comment
Hide comment
@rooiejoris

rooiejoris Aug 18, 2014

haven't tried anything, just didn't know where to start
i have a .hex file and read something like avrdude
and "upload" should be my hex file or my arduino file...!?

cheers \ joris

On Mon, Aug 18, 2014 at 2:09 PM, Guy Sheffer notifications@github.com
wrote:

Also what does ino upload -p /dev/ttyACM0 -m mega2560 do?

Reply to this email directly or view it on GitHub
#23 (comment).

rooiejoris commented Aug 18, 2014

haven't tried anything, just didn't know where to start
i have a .hex file and read something like avrdude
and "upload" should be my hex file or my arduino file...!?

cheers \ joris

On Mon, Aug 18, 2014 at 2:09 PM, Guy Sheffer notifications@github.com
wrote:

Also what does ino upload -p /dev/ttyACM0 -m mega2560 do?

Reply to this email directly or view it on GitHub
#23 (comment).

@CptanPanic

This comment has been minimized.

Show comment
Hide comment
@CptanPanic

CptanPanic Jan 23, 2015

In case anyone wants to try this, I just setup another octopi, and found an easy way. MarlinFirmware uses a special build script, which you can just follow along to get all the instructions and dependencies. https://github.com/MarlinFirmware/Marlin/blob/Development/.travis.yml

CptanPanic commented Jan 23, 2015

In case anyone wants to try this, I just setup another octopi, and found an easy way. MarlinFirmware uses a special build script, which you can just follow along to get all the instructions and dependencies. https://github.com/MarlinFirmware/Marlin/blob/Development/.travis.yml

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Jan 24, 2015

Owner

Any idea how we can invoke this script form OctoPi?
Perhaps @hroncok might know how to run a travis script since you tried to have a travis build for OctoPi?

Owner

guysoft commented Jan 24, 2015

Any idea how we can invoke this script form OctoPi?
Perhaps @hroncok might know how to run a travis script since you tried to have a travis build for OctoPi?

@hroncok

This comment has been minimized.

Show comment
Hide comment
@hroncok

hroncok Jan 24, 2015

Contributor

I know no way to run a travis script locally, but it is just a set of bash commands. You can transform it to bash script either manually, or automatically eg. with PyYAML, or in this simple case even with sed.

But you don't want to run this script as it is, it just builds and deletes, builds and deletes.

If you want to build and upload Marlin from the device, all you need is ino, it can do both. No need for script, this is what you need:

  1. Have your Marlin source code in a directory
  2. Link or move the inner Marlin dir to src
  3. Remove Marlin.pde in case you have it, and only keep Marlin.ino
  4. Run ino build -m mega2560 (or similar)
  5. Run ino upload

Also note that you might need other libraries use by Marlin, such as LiquidCrystal_I2C.h, if you use them, or remove their reference from Marlin.ino (due to a bug). See the Marlin's Travis script to see where they get it.

(I'm also not very sure if building Marlin for atmel on arm would be reasonable (in the matter of time), but never tried it.)

Contributor

hroncok commented Jan 24, 2015

I know no way to run a travis script locally, but it is just a set of bash commands. You can transform it to bash script either manually, or automatically eg. with PyYAML, or in this simple case even with sed.

But you don't want to run this script as it is, it just builds and deletes, builds and deletes.

If you want to build and upload Marlin from the device, all you need is ino, it can do both. No need for script, this is what you need:

  1. Have your Marlin source code in a directory
  2. Link or move the inner Marlin dir to src
  3. Remove Marlin.pde in case you have it, and only keep Marlin.ino
  4. Run ino build -m mega2560 (or similar)
  5. Run ino upload

Also note that you might need other libraries use by Marlin, such as LiquidCrystal_I2C.h, if you use them, or remove their reference from Marlin.ino (due to a bug). See the Marlin's Travis script to see where they get it.

(I'm also not very sure if building Marlin for atmel on arm would be reasonable (in the matter of time), but never tried it.)

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Jun 17, 2015

Owner

Just tried @CptanPanic 's #23 (comment) and it worked for me.
I am still on the bench regarding shipping it, the image is pretty bloated already.

Owner

guysoft commented Jun 17, 2015

Just tried @CptanPanic 's #23 (comment) and it worked for me.
I am still on the bench regarding shipping it, the image is pretty bloated already.

@foosel

This comment has been minimized.

Show comment
Hide comment
@foosel

foosel Jul 5, 2015

Collaborator

Voting against it, should instead be a plugin. It also would only work for Marlin targeting boards where the flashing can be done this easily (try that with a printrboard for example), so you'd basically be shutting out quite a number of differing printer electronics (and firmwares)

Collaborator

foosel commented Jul 5, 2015

Voting against it, should instead be a plugin. It also would only work for Marlin targeting boards where the flashing can be done this easily (try that with a printrboard for example), so you'd basically be shutting out quite a number of differing printer electronics (and firmwares)

@jneilliii

This comment has been minimized.

Show comment
Hide comment
@jneilliii

jneilliii Jul 24, 2015

I've had good success with the plugin linked below to achieve uploading and flashing from the settings panel...

https://github.com/Booli/OctoPrint-flashArduino

jneilliii commented Jul 24, 2015

I've had good success with the plugin linked below to achieve uploading and flashing from the settings panel...

https://github.com/Booli/OctoPrint-flashArduino

@guysoft

This comment has been minimized.

Show comment
Hide comment
@guysoft

guysoft Aug 2, 2015

Owner

@foosel What needs to happen for that plugin to enter the plugin manager?
https://github.com/Booli/OctoPrint-flashArduino

Owner

guysoft commented Aug 2, 2015

@foosel What needs to happen for that plugin to enter the plugin manager?
https://github.com/Booli/OctoPrint-flashArduino

@foosel

This comment has been minimized.

Show comment
Hide comment
@foosel

foosel Aug 2, 2015

Collaborator

The author needs to release it and do a PR against the plugin repo to have it included in the manager. I know that it is still a work in progress, so give the people some time ;)

Collaborator

foosel commented Aug 2, 2015

The author needs to release it and do a PR against the plugin repo to have it included in the manager. I know that it is still a work in progress, so give the people some time ;)

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