[SOLVED] Can't Seem to Program Arduino Uno

Hey All,

Apologies if this question has been asked but I’ve searched the forums with no luck yet. I should preface that I am in no way a competent programmer, I have taken a few Kahn academy courses and consider myself technically savy for the average guy on the street, but that’s it.

I’m trying to build a BrewPi setup using a Raspberry Pi 2and a Sanismart Uno Arduino. I successfully installed Raspbian and ran the BrewPi install script, BrewPi opens up on the browser and the script is running. I installed this yesterday so I can only assume it’s the current version of BrewPi.

Essentially I can’t seem to get the Maintenance panel within BrewPi to program the Arduino. I did successfully execute the blink test through the Arduino IDE but so far that’s all I can get to work.

When I try to use the maintenance panel to program the Arduino, I consistently get this error message:

“Cannot receive version number from Arduino. Your Arduino is either not
programmed or running a very old version of BrewPi. Please upload a new
version of BrewPi to your Arduino”

I’ve seen other posts with this error but they all have additional content output by BrewPi that I don’t see on my screen.

I’m using the Arduino Uno Hex file from here, I’ve tried both versions A and C: https://github.com/BrewPi/firmware/releases/tag/0.2.10

I’ve even tried using some newer Hex files that I know are not correct for my Arduino to see if i could simply get it to flash onto it with a newer version, but no luck. I’ve attempted the troubleshooting tips as well but no luck (header 4.2 here: http://docs.brewpi.com/after-install/program-arduino.html)

Any suggestions?

Did you run:

sudo ~/brewpi-tools/updater.py --ask

And choose the legacy branch?

Nope but I will try that. Would this downgrade me to a legacy version of BrewPi?

Yes, the newest version won’t run on an Arduino. You can also try flashing the hex file with xloader: http://xloader.russemotto.com/

Thanks Elco! I did try using Xloader but ran into driver issues.

Xloader seems to have done the trick!

The following command worked for me with using an Arduino. Run this command and then try to program again.

sudo echo ‘E\n’ > /dev/ttyACM0

There is a button to reset the settings stored in EEPROM in the web interface now (bottom of advanced settings). There should be no need to run that manually now. I don’t think that was the issue though.

All set gents, thanks for the help! Got it up and running and successfully tested it, switches between heat and cool correctly. Thanks for everything you do Elco!

Hi Elco,

Think I’m having similar issues, I have the latest Arduino Uno (Arduino Uno ATmega328 MCU Board Rev 3).

I have:

  • reset the device using sudo echo ‘E\n’ > /dev/ttyACM0

  • I can successfully install the blink test from my mac using the usb cable

  • I can interagate the device using avrdude from the pi:

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e950f
    avrdude: Expected signature for AT90USB82 is 1E 93 82

    avrdude: safemode: Fuses OK (E:00, H:00, L:00)

    avrdude done. Thank you.

I’m using a Rap. Pi. model B, and latest version of debian installed

I have checked out and loaded the legacy version of the software

I’m getting these errors:

Feb 10 2016 21:57:07 Opening serial port
Feb 10 2016 21:57:07 Notification: Script started for beer 'My First BrewPi Run'
Feb 10 2016 21:57:17 Checking software version on controller... 
Feb 10 2016 21:57:27 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
Feb 10 2016 21:58:07 Opening serial port
Feb 10 2016 21:58:07 Notification: Script started for beer 'My First BrewPi Run'
Feb 10 2016 21:58:17 Checking software version on controller... 
Feb 10 2016 21:58:27 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.

I have not had much luck with XLoader it does not respond :frowning: on my Mac when I try to upload a hex file

I’m using brewpi-arduino-uno-revC-0_2_10.hex of the firmware and selecting uno in the web interface, the file gets uploaded to uploads correctly, but not applied.

Any help would be very gratefully appriciated, I’ve been hacking away at this for a few days now.

Thanks in advance !

OK, I’ve just installed grblflash https://dl.dropboxusercontent.com/u/54312401/grbl/grblflash on another linux box, though sure will work on the pi too and the firmware has now installed corectly.

1 Like

Thanks! had same issue when i updated to a RPI 3 thanks for the GRBLFLASH link, works fine from RPI

I was having problems getting the script to recognise the Arduino clone.

I ran

sudo echo ‘E\n’ > /dev/ttyACM0

then flashed the .hex file on the ‘Funduino Uno’ using grbflash

All good now.

thanks guys!

You got the order of that wrong. The reset EEPROM command does nothing if the firmware is not installed yet.

Try the legacy_dev branch please. It should work again to just flash from the web interface.

Thanks Elco,
To be fair I was trying a number of things in no particular order. The good thing it is operational now.

Thanks again

Hi Elco (or anyone else),

I am new to programming and this is my first BrewPi Community post. I have successfully installed the BrewPi web interface on my RPi. When I am trying to program the Arduino using the brewpi-arduino-uno-revC-0_2_10.hex firmware, I am getting the same error message as everyone else.

“Cannot receive version number from Arduino. Your Arduino is either not
programmed or running a very old version of BrewPi. Please upload a new
version of BrewPi to your Arduino”

I made sure I was using the legacy branch. I tried resetting the EEPROM using the code posted, as some have suggested. I tried different programming settings in the controller settings. I was going to try the Xloader option, but I am using a Mac. Nothing that I have read seems to work.

Any help would be appreciated!

Is your legacy branch up to date? Then the updater should be able to program your Arduino.

The reset EEPROM code does nothing if the Arduino is not programmed, it is a BrewPi specific command. In fact, it should not be used anymore, there is a button in the web interface to reset to factory defaults.

Ok. So I went back (again) and updated my legacy branch. I even tried the legacy_dev as you suggested to someone else. Currently back on legacy. This is what I get:

*** Updating BrewPi web interface repository ***
You are on branch legacy

Available branches on the remote ‘origin’ for /var/www:
[0] beta
[1] develop
[2] feature/chart-export
[3] feature/notifications
[4] legacy
[5] master
[6] Skip updating this repository
Enter the number of the branch you wish to update [legacy]:4
The latest commit in /var/www is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 05:16:11
The latest commit on origin/legacy is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 05:16:11
Your local version of /var/www is up to date!

No changes were made, skipping runAfterUpdate.sh.
If you encounter problems, you can start it manually with:
sudo /home/brewpi/utils/runAfterUpdate.sh

The update script can automatically check your controller firmware version and program it with the latest release on GitHub, would you like to do this now? [Y/n]:y
Stopping any running instances of BrewPi to check/update controller…

Checking current firmware version…
Apr 20 2016 20:59:44 Opening serial port
Unable to receive version from controller.
Is your controller unresponsive and do you wish to try restoring your firmware? [y/N]:
y
Traceback (most recent call last):
File “/home/brewpi/utils/updateFirmware.py”, line 263, in
result = updateFromGitHub(userInput=userInput, beta=beta, useDfu=useDfu)
File “/home/brewpi/utils/updateFirmware.py”, line 76, in updateFromGitHub
if “Particle” in name:
TypeError: argument of type ‘NoneType’ is not iterable

*** Done updating BrewPi! ***

Then, went to BrewPi interface and reset controller to factory defaults under advanced settings. Finally, went to Reprogram Controller. Uploaded hex code as stated in earlier reply, chose Arduino Uno, and both settings were changed to NO. Went to Program the Arduino and this is what I get:

**** Arduino Program script started ****
Settings will not be restored
Devices will not be restored
Apr 20 2016 20:57:48 Opening serial port
Loading programming settings from board.txt
Checking hex file size with avr-size…
Program size: 26896 bytes out of max 32256
ERROR: could not find port in bootloader
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 649, in
{‘settings’: restoreSettings, ‘devices’: restoreDevices})
File “/home/brewpi/programController.py”, line 163, in programController
return programmer.program(hexFile, system1File, system2File, useDfu, restoreWhat)
File “/home/brewpi/programController.py”, line 274, in program
if not self.flash_file(hexFile):
File “/home/brewpi/programController.py”, line 650, in flash_file
’ -C ’ + avrconf)
TypeError: cannot concatenate ‘str’ and ‘NoneType’ objects
Apr 20 2016 20:58:03 Opening serial port
Apr 20 2016 20:58:03 Notification: Script started for beer 'Under Construction’
Apr 20 2016 20:58:04 Checking software version on controller…
Apr 20 2016 20:58:14 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.
Apr 20 2016 20:58:44 quit message received on socket. Stopping script.
Apr 20 2016 21:00:03 Opening serial port
Apr 20 2016 21:00:03 Notification: Script started for beer 'Under Construction’
Apr 20 2016 21:00:04 Checking software version on controller…
Apr 20 2016 21:00:14 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your Arduino.

Thanks for your help!

The problem is that it cannot find a compatible serial device.

I have updated the code to print a better error message.

Please run: python autoSerial.py and check its output. It will list the available serial ports and show what it thinks is compatible.

Here is what I got after entering the code:

python: can’t open file ‘autoSerial.py’: [Errno 2] No such file or directory

I’m guessing based on your description that my Arduino is not recognizing any serial ports.