Can’t send HEX to Arduino Uno

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. I also update Brewpi with ‘sudo python ~/brewpi-tools/updater.py’.
Then 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.

Mar 18 2018 16:32:41 Background thread for serial stopped
Couldn’t detect a compatible board to program
Mar 18 2018 16:32:41 New program uploaded to controller, script will restart
Mar 18 2018 16:32:47 Notification: Script started for beer ‘My First BrewPi Run’
Mar 18 2018 16:32:47 Connecting to controller…
Mar 18 2018 16:32:47 Background thread for serial started
Mar 18 2018 16:32:47 Serial (re)connected at port: /dev/ttyACM0
Mar 18 2018 16:32:57 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.

Any help would be appreciated!

You should switch to the legacy branch for both the script and Web interface.

Arduino is no longer supported.

I just went through this and Elco was kind enough to walk me through it. Keep in mind that the latest versions of BrewPi only work with the Spark, which is a lot more capable than the Arduino and has modular connectors to make installation easier and more reliable.

I found the Docker container version of BrewPi does not include the legacy code. I had to use the automated installation detailed in the documentation before I could make the switch. In my case, because I am running raspian stretch, I also had to install php5 for BrewPi to work. Here are the steps I took:

  1. add repo to apt-get (at the end of /etc/apt/sources.list):
    deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
  2. update packages:
    sudo apt-get update
    sudo apt-get upgrade
  3. install php5:
    sudo apt-get -y install php5 php5-curl php5-cli php5-mysql php5-gd
    sudo update-alternatives --set php /usr/bin/php5
  4. install brewpi:
    sudo apt-get install git
    git clone https://github.com/BrewPi/brewpi-tools.git ~/brewpi-tools
    sudo ~/brewpi-tools/install.sh
  5. change to legacy brewpi for arduino:
    sudo su - brewpi
    git checkout legacy
    cd /var/www/html
    git checkout legacy
    ^d

Cheers,
Bob

Edit: And, to answer your original question, I used a utility called HexUploader (I use a Mac) to program the Arduino with firmware 0.2.10. You can find the brewpi-arduino-uno-revC-0_2_10.hex file in the BrewPi GitHub.

You should be able to use the docker install.
Just switch to the legacy branch after you have deployed the container.

Haven’t tested it but I think this should do it:

docker exec -it brewpi bash
git checkout legacy 
cd /var/www/html
git checkout legacy
exit

Hmmm, that’s exactly what I tried. I’ll try again!

I resolved the problem to load the program on arduino. the program is load correctly and on arduino the light TX and RX start but now the script non running and not start.
Thank you for the answers.

Still getting the error:

error: pathspec ‘legacy’ did not match any file(s) known to git.

Edit:
On the container version I get the following output from git show-ref:
root@0e135eb9f54d:/home/brewpi# git show-ref
72dbd015338350d61ebbade909c6b975c50ea744 refs/heads/master
72dbd015338350d61ebbade909c6b975c50ea744 refs/remotes/origin/HEAD
72dbd015338350d61ebbade909c6b975c50ea744 refs/remotes/origin/master

On the installed version, I get this:
pi@brewpi:/home/brewpi $ git show-ref
8b782f0fd5a1d58cfb4f6f08d37ef8f8ef51f28e refs/heads/legacy
72dbd015338350d61ebbade909c6b975c50ea744 refs/heads/master
72dbd015338350d61ebbade909c6b975c50ea744 refs/remotes/origin/HEAD
72dbd015338350d61ebbade909c6b975c50ea744 refs/remotes/origin/develop
8b782f0fd5a1d58cfb4f6f08d37ef8f8ef51f28e refs/remotes/origin/legacy
f8b8840904852542b46bb7c825a8adf26f8ac396 refs/remotes/origin/legacy_dev
72dbd015338350d61ebbade909c6b975c50ea744 refs/remotes/origin/master
64d3636395e91078a4c6bf004373d067138331cd refs/remotes/origin/release/0.5.0
89a9274a4dd2d37fe646091bebd3c7e1322de237 refs/tags/0.1.1
11f550c4ff433377c11f05d18c0a832ab7c33b76 refs/tags/0.2.0
48aee8362a77c18c010b78f2090386c04c7e35c2 refs/tags/0.2.0.1
08462713a328bce8d5aa0f926c9a776a2f1db0db refs/tags/0.2.0.2
b6dea28e0e6818b0e3227ff4833bf898877c8795 refs/tags/0.2.0.3
6900c121f11ad5315a529df0510664e518545465 refs/tags/0.2.0.4
61e3c9411078cd19c1d30ce6533c0550d5b343c4 refs/tags/0.2.0.4.1
4a78ab872164abeead0831daee967c7dfaabf788 refs/tags/0.3.0
b7887e5e68568cedef85d30c8e2f6525907e337d refs/tags/0.3.0.1
49d22002402ddd93b754f489110d3226d8c9bd02 refs/tags/0.3.1
cc0d4d68ad7e22405ee0e668a4b4d21da7313c15 refs/tags/0.3.1.1
89af65b24c360074fc52200048462a18f46ee538 refs/tags/0.3.2
81ab5414a68ddcaa924909213a6d6118406b8a7d refs/tags/0.3.3.1
93efabe14d02f3ba4e48eae917fd1f0d48aa9021 refs/tags/0.3.4
8cf45fe8c63e46799e2d9abd04a942bf6212a429 refs/tags/0.3.4.1
53970143e3c5798d0abd42e4f04d51aafe76e84f refs/tags/0.3.4.2
bc00ea3d296ae968530524949d7ad9b849d41d08 refs/tags/0.3.4.3
05129def6b7bb9dd685c46d26c350d5e2676ca8f refs/tags/0.3.4.4
a4b77e90e8ad6efd0d581bc5e2962072c7483a75 refs/tags/0.3.5
67aee8d2c92f9598d75e8226c93e4d5d77f94c39 refs/tags/0.3.6
3e563b747e9d187a5188f94f0cc0def3c50a27d5 refs/tags/0.3.6.1
7c84b284855db10e2fdea10e2bd98717ea480069 refs/tags/0.3.6.2
01e9bb81102e4584523495788412a6674a36fb16 refs/tags/0.3.6.3
cbcbf64671b77cdac8fc194537b7aed2c42adec8 refs/tags/0.3.7
45433b315ad34a530a37d04c163bc3d85065f859 refs/tags/0.3.7.1
0c7b1f9868bda9c0442ddaa429241be1b00a3b4b refs/tags/0.3.8
242ffab34e9b8478e566b96014160a9c77afdd21 refs/tags/0.4.0
eb21e41a17c52991bb37044f4c8f4a5de33540d3 refs/tags/0.4.1
ff8693a824640f930c3eb976dbeda576d86b9645 refs/tags/0.4.2
514fb09d68db23db3cee7ae2fab720719885c812 refs/tags/0.4.3
100b0ac61f694737ebdf2a013a08e04bcf013923 refs/tags/0.4.5
736d04a784f85ff527576ddac6b447ee311197e3 refs/tags/serial-error-message
bb16303f0e529b39fecdb88ef167650c291bc4b6 refs/tags/skip-settings-restore-without-version
7d9bd1bb544c3624ac09237f6c390c8e853e31f5 refs/tags/v0.1
b27ec707f8efdbeb3f382c718f63132e904de1c6 refs/tags/wificheck-cron-fix

After some googling I have figured out why. It is because the docker file does a shallow clone.

Updated instructions:

docker exec -it brewpi bash
git fetch --unshallow
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
git checkout legacy 
cd /var/www/html
git fetch --unshallow
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
git checkout legacy
exit

Wow, thanks for this! I know you have better things to do than screw around with the legacy code. For me, the Arduino approach is attractive because I love to tinker and build things, and (maybe more importantly) I already have one that’s just sitting on the shelf. Now I get to learn a little bit about Docker, too.

Cheers,
Bob

Hello. thanks in advance for your patience as I’m asking a total noob question. Where would I enter these commands? Would these be entered through the console in the brew pi container?

Sorry for the foolish question earlier. I entered the commands at the command prompt in my raspberry pi. However, I then tried to program the arduino uno from the maintenance panel by pointing it to use the brewpi-arduino-uno-revC-0_2_10.hex file i downloaded from BrewPi GitHub and received the following

Nov 21 2018 10:51:25 Fresh start! Log files erased.
Nov 21 2018 10:53:33 Background thread for serial stopped
Couldn’t detect a compatible board to program
Nov 21 2018 10:53:33 New program uploaded to controller, script will restart
Nov 21 2018 10:53:39 Notification: Script started for beer ‘My First BrewPi Run’
Nov 21 2018 10:53:39 Connecting to controller…
Nov 21 2018 10:53:39 Background thread for serial started
Nov 21 2018 10:53:49 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.
Nov 21 2018 10:59:53 stopScript message received on socket. Stopping script and writing dontrunfile to prevent automatic restart
Nov 21 2018 10:59:53 Background thread for serial stopped
Nov 21 2018 11:00:04 Notification: Script started for beer ‘My First BrewPi Run’
Nov 21 2018 11:00:04 Connecting to controller…
Nov 21 2018 11:00:04 Background thread for serial started
Nov 21 2018 11:00:14 Warning: Cannot receive version number from controller. Check your port setting in the Maintenance Panel or in settings/config.cfg.

Can someone please help me to understand what I’m doing wrong? Thanks in advance for any help that you can offer!

I recommend:

  • download the hex file from GitHub releases manually and use a program like xloader to get it on your Arduino.
  • upgrade to a Spark 3 some day, because our arduino software is very outdated and no longer supported.