Skip to content

Print warning or ask when arduino dir is not found. #31

Description

@elcojacobs

Our policy is to load the tool locations from the config file, but when they are not set assume default locations.

If these default locations don't have the tools, we should warn, print the issue at hand and how to correct it (instructions to edit config.cfg), instead of crashing.

Relevant piece of code:
https://github.com/BrewPi/brewpi-script/blob/master/programArduino.py#L66

Current behavior:

result of invoking avrdude:
/bin/sh: 1 arduinohome/hardware/tools/avrdude: not found

The script continues , gives the countdown,etc. and eventually tells me that it "Cannot receive version number".

Or:

When I try with programArduinoFirstTime.py ...

**** Arduino Program script started ****

Settings will be restored if possible

Devices will be restored if possible

Checking old version before programming.

Warning: Cannot receive version number from Arduino. Your Arduino is either not programmed yet or running a very old version of BrewPi. Arduino will be reset to defaults.

Loading programming settings from board.txt

Checking hex file size with avr-size...

Traceback (most recent call last):
File "programArduinoFirstTime.py", line 39, in
result = programmer.programArduino(config, boardType, hexFile, {'settings': True, 'devices': True})
File "/home/brewpi/programArduino.py", line 171, in programArduino
' bytes out of max ' + boardSettings['upload.maximum_size']))
KeyError: 'upload.maximum_size'

Reported here:
http://forum.brewpi.com/discussion/553/need-help-programming-arduino

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions