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

Add arduino_ide package #2888

Merged
merged 1 commit into from Nov 27, 2018
Merged

Add arduino_ide package #2888

merged 1 commit into from Nov 27, 2018

Conversation

JL2210
Copy link
Contributor

@JL2210 JL2210 commented Nov 20, 2018

Fixes #2841
Depends on #2887

Add arduino_ide package

Tested on:

  • x86_64

packages/arduino_ide.rb Outdated Show resolved Hide resolved
packages/arduino_ide.rb Outdated Show resolved Hide resolved
Update to use ENV["CREW_NOT_STRIP"]
@uberhacker
Copy link
Collaborator

@JL2210: Were you planning on updating this PR? We only need a few changes, correct?

@JL2210
Copy link
Contributor Author

JL2210 commented Nov 26, 2018

@uberhacker Done.

@JL2210
Copy link
Contributor Author

JL2210 commented Nov 26, 2018

I was away from the Chromebook/Internet over Thanksgiving. I had an uncle over.

system "echo 'sudo chmod o+w /dev/ttyACM*' >> arduino"
system "echo 'sommelier -X --x-display=\$DISPLAY --scale=\$SCALE #{CREW_PREFIX}/share/arduino-#{version}/arduino \"$@\"' >> arduino"
system "echo 'echo \"Disabling Arduino write access...\"' >> arduino"
system "echo 'sudo chmod o-w /dev/ttyACM*' >> arduino"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow this logic. Why do you need write access to the devices? That seems odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you can flash the compiled code to their chips/onboard storage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need write access to device files to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The /dev/ttyACM* files are device files pointing to to the Arduino devices.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs to write to the device files? That doesn't make any sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board."
The Arduino IDE needs to write the compiled code to the Arduino via. the device files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it needs to write to Arduino, not the actual device files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onboard storage of the Arduino IS the device file. The device file isn't writable unless we allow write access to it, which we're doing with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system "echo >> arduino"
system "echo 'echo \"Enabling Arduino write access...\"' >> arduino"
system "echo 'sudo chmod o+w /dev/ttyACM*' >> arduino"
system "echo 'sommelier -X --x-display=\$DISPLAY --scale=\$SCALE #{CREW_PREFIX}/share/arduino-#{version}/arduino \"$@\"' >> arduino"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the sommelierd daemon handle this also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work in this case. There must be something wrong with it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing wrong with sommelier. You likely just need to create a symlink:

system "ln -s #{CREW_PREFIX}/share/arduino-#{version}/arduino #{CREW_DEST_PREFIX}/bin/arduino"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work. The sommelier daemon doesn't run it properly. It also still needs to make the device files writable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm still not understanding why you would need to write to device files. A device file is not meant for storage. If you run the arduino executable by itself, it should work with the sommelierd daemon running just like any other executable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The application accesses the Arduino by way of opening the device files. It evidently doesn't work, even while running startsommelier && /usr/local/share/arduino-1.8.7/arduino.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I guess this is enough back and forth. I'm merging it. :)

@uberhacker uberhacker merged commit 4ea0f45 into chromebrew:master Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants