Updating manually (because I'm running multiple instances of BrewPi on one pi)

cant update firmware at all. not from the script nor from the webui. getting bad callback errors in the script and some permissions issues. ill dig a bit further to see whats up

Edit (Admin): I have moved the discussion to a new topic.

I had to run the updater a few times for success. Each time the updater got further and further.

I was able to get the hex file uploaded. But I had to go back to my vm test bed and upload it using the last version gui and manually uploading using the maintenance panel. Now I have to figure out what’s going on with my pi. For some reason I have to keep unplugging/plugging in my arduino to get it to register as a usb device. But it works fine when connected over bluetooth. One of the issues was with not having proper permissions to use the old setting logs folder. Even if I told it not to restore old settings. And some bad lines in a few Python scripts. I need to go back into my logs when I get a chance and see what exactly I need to hunt down. But given how far I had to go to workaround this issue, I’m not calling it a success just yet.

EDIT:

Here is my logs from trying to update to the new firmware

Traceback (most recent call last):
File “/home/brewpi/brewpi1/brewpi.py”, line 191, in
allProcesses.update()
File “/home/brewpi/brewpi1/BrewPiProcess.py”, line 129, in update
bp = self.parseProcess§
File “/home/brewpi/brewpi1/BrewPiProcess.py”, line 143, in parseProcess
cfg = [s for s in process.cmdline() if ‘.cfg’ in s] # get config file argument
File “/usr/local/lib/python2.7/dist-packages/psutil/init.py”, line 565, in cmdline
return self._proc.cmdline()
File “/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py”, line 654, in wrapper
raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: process no longer exists (pid=12578, name=‘python’)

oh and ive been getting a lot of lines where it warns about multiple instances running and having to shutdown this one. I cant see where it affected anything but I’m not used to seeing so many script instance errors in this configuration. there would always be a few peppered in there with 8 instances installed and at least 3-4 running all the time. I dont think its a problem so far, it just looked weird to me.

Most permission errors should be fixed now. They were caused by the updater running as root and the script later trying to access the same location but not having the permissions for the files created by root.

I have also just added an exception for the error above (which I think must be rare): the process quit in between getting the lists of processes and parsing them.

I have also changed added IOError to the caught exceptions when connecting to serial and ensure that the in and output is flushed before starting to use it.

I now also remove compiled python files (*.pyc) after the update, because they might cause issues.

Please post a log of all errors you get and I’ll try to fix them asap.

cool should i do another pull request or do i need just one or two files to fix this error. i was just coming back here to post that the only thing i can come up with was that the process quit along the way because of the multiple scripts trying to run. Im actually beginning to think my problem is that I only have one instance up right now while updating. and because the other 7 are trying over and over again to start that its causing all the instances to quit at some point.

I think you mean pull, not pull request. A pull request is when you contribute to our code and ask us to merge your contribution. But yes, just do a pull.

So now nothing happens. I hit upload and the log file shows up with only the previous entries in it. nothing starts and nothing tries to program. if i go into an instance that doesnt have a device connected to it the log spits out that it cannot find the device, trying an alternate port.

EDIT:

i found an error in my config file for this particular instance. but now this:

{'settings': restoreSettings, 'devices': restoreDevices})
File "/home/brewpi/brewpi8/programController.py", line 179, in programController
return programmer.program(hexFile, restoreWhat)
File "/home/brewpi/brewpi8/programController.py", line 225, in program
self.save_settings_to_file()
File "/home/brewpi/brewpi8/programController.py", line 365, in save_settings_to_file
oldSettingsFile = open(settingsBackupDir + oldSettingsFileName, 'wb')
IOError: [Errno 13] Permission denied: '/home/brewpi/brewpi8/settings/controller-backup/settings-Apr-14-2015-19-09-30.json'
Apr 15 2015 19:55:05 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 19:55:06 Checking software version on controller... 
Apr 15 2015 19:56:30 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 19:56:31 Checking software version on controller... 
Apr 15 2015 19:56:41 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.
**** Arduino Program script started ****
Settings will not be restored
Devices will not be restored
Checking old version before programming.
Warning: Cannot receive version number from Arduino. Your %(a)s is either not programmed yet or running a very old version of BrewPi. %(a)s will be reset to defaults.
Loading programming settings from board.txt
Checking hex file size with avr-size...
Program size: 26416 bytes out of max 30720
Programming Arduino with avrdude: /usr/share/arduino/hardware/tools/avrdude -F -e -p atmega328p -c arduino -b 57600 -P /dev/ttyUSB0 -U flash:w:"brewpi-arduino-uno-revC.hex" -C /usr/share/arduino/hardware/tools/avrdude.conf
Result of invoking avrdude:

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: reading input file "brewpi-arduino-uno-revC.hex"
avrdude: input file brewpi-arduino-uno-revC.hex auto detected as Intel Hex
avrdude: writing flash (26416 bytes):

Writing | ################################################## | 100% 8.40s

avrdude: 26416 bytes of flash written
avrdude: verifying flash memory against brewpi-arduino-uno-revC.hex:
avrdude: load data flash data from input file brewpi-arduino-uno-revC.hex:
avrdude: input file brewpi-arduino-uno-revC.hex auto detected as Intel Hex
avrdude: input file brewpi-arduino-uno-revC.hex contains 26416 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.61s

avrdude: verifying ...
avrdude: 26416 bytes of flash verified

avrdude done. Thank you.


Avrdude done, programming succesful!
Giving the Arduino a few seconds to power up...
Back up in 5...
Back up in 4...
Back up in 3...
Back up in 2...
Back up in 1...
Back up in 0...
Waiting for device to reset.
Warning: Cannot receive version number from Arduino. Your %(a)s is either not programmed yet or running a very old version of BrewPi. %(a)s will be reset to defaults.
Resetting EEPROM to default settings
Warning: Cannot receive version number from controller after programming. 
Something must have gone wrong. Restoring settings/devices settings failed.

Apr 15 2015 19:57:54 New program uploaded to controller, script will restart
Apr 15 2015 19:58:00 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 19:58:01 Checking software version on controller... 
Apr 15 2015 19:58:10 Found BrewPi vL)THs on port /dev/ttyUSB0

Apr 15 2015 19:58:10 Warning: version number of local copy of logMessages.h does not match log version number received from controller.controller version = 0, local copy version = 1
Apr 15 2015 19:58:12 Cannot process line from controller: s^BJI@1_9s
C"kJMC$)es_)s
Apr 15 2015 19:58:14 Cannot process line from controller: _)sJID9^JIkJMIC$)B5U
C"k$JI
Apr 15 2015 19:58:15 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 19:58:15 Line received was: C
C(FTk	C$
Apr 15 2015 19:58:20 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 19:58:20 Line received was: C$esFTJks\NMIC$kes
C5UB5aU
"JID9_JH
(FTH
CJML)sPNML)sP
C5[ALJID)s^JIk$JI)
Apr 15 2015 19:58:21 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 19:58:21 Line received was: CaUC$)FT
CNMIC$)Da[ANk$4FTH
Apr 15 2015 19:58:22 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 19:58:22 Line received was: C")sDa[ANk$4FTH
Apr 15 2015 19:58:23 Cannot process line from controller: \_JH)sPFT)
Apr 15 2015 19:58:27 Cannot process line from controller: \JM
C5a[ALFUJksNM
C"1FB5a[AL
"BJI@9_)s
"1aUC$NMkC$kesJID9_JHFT)
Apr 15 2015 19:58:30 Cannot process line from controller: \JMs
"1F	C5[AHB5aU
CsP9FT)
Apr 15 2015 19:58:32 Cannot process line from controller: \NMFTJks\NMIC$kesBJI@1_F	C$5[AHs
C"1Fk$JI
**** Arduino Program script started ****
Settings will not be restored
Devices will not be restored
Checking old version before programming.
Checking current version: Found BrewPi vL)s\JI on port /dev/ttyUSB0

Requesting old settings from Arduino...
JSON decode error: Expecting value: line 1 column 1 (char 0)
Line received was: Ces\JI

JSON decode error: Expecting value: line 1 column 1 (char 0)
Line received was: CTNMIC$)FT_B5[AL"1
C
Traceback (most recent call last):
File "/home/brewpi/brewpi8/brewpi.py", line 664, in 
{'settings': restoreSettings, 'devices': restoreDevices})
File "/home/brewpi/brewpi8/programController.py", line 162, in programController
return programmer.program(hexFile, restoreWhat)
File "/home/brewpi/brewpi8/programController.py", line 206, in program
self.retrieve_settings_from_serial()
File "/home/brewpi/brewpi8/programController.py", line 327, in retrieve_settings_from_serial
line = ser.readline()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 475, in read
raise SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Apr 15 2015 20:04:04 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 20:04:05 Checking software version on controller... 
Apr 15 2015 20:04:15 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 15 2015 20:04:29 stopScript message received on socket. Stopping script and writing dontrunfile to prevent automatic restart
Apr 15 2015 20:11:05 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 20:11:06 Checking software version on controller... 
Apr 15 2015 20:11:16 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 15 2015 20:12:19 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 20:12:29 Checking software version on controller... 
Apr 15 2015 20:12:39 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.
**** Arduino Program script started ****
Settings will not be restored
Devices will not be restored
Checking old version before programming.
Warning: Cannot receive version number from Arduino. Your %(a)s is either not programmed yet or running a very old version of BrewPi. %(a)s will be reset to defaults.
Loading programming settings from board.txt
Checking hex file size with avr-size...
Program size: 26416 bytes out of max 30720
Programming Arduino with avrdude: /usr/share/arduino/hardware/tools/avrdude -F -e -p atmega328p -c arduino -b 57600 -P /dev/ttyUSB0 -U flash:w:"brewpi-arduino-uno-revC.hex" -C /usr/share/arduino/hardware/tools/avrdude.conf
Result of invoking avrdude:

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: reading input file "brewpi-arduino-uno-revC.hex"
avrdude: input file brewpi-arduino-uno-revC.hex auto detected as Intel Hex
avrdude: writing flash (26416 bytes):

Writing | ################################################## | 100% 8.42s

avrdude: 26416 bytes of flash written
avrdude: verifying flash memory against brewpi-arduino-uno-revC.hex:
avrdude: load data flash data from input file brewpi-arduino-uno-revC.hex:
avrdude: input file brewpi-arduino-uno-revC.hex auto detected as Intel Hex
avrdude: input file brewpi-arduino-uno-revC.hex contains 26416 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.61s

avrdude: verifying ...
avrdude: 26416 bytes of flash verified

avrdude done. Thank you.


Avrdude done, programming succesful!
Giving the Arduino a few seconds to power up...
Back up in 5...
Back up in 4...
Back up in 3...
Back up in 2...
Back up in 1...
Back up in 0...
Waiting for device to reset.
Warning: Cannot receive version number from Arduino. Your %(a)s is either not programmed yet or running a very old version of BrewPi. %(a)s will be reset to defaults.
Resetting EEPROM to default settings
Warning: Cannot receive version number from controller after programming. 
Something must have gone wrong. Restoring settings/devices settings failed.

Apr 15 2015 20:13:49 New program uploaded to controller, script will restart
Apr 15 2015 20:13:55 Notification: Script started for beer 'My First BrewPi Run'
Apr 15 2015 20:14:05 Checking software version on controller... 
Apr 15 2015 20:14:10 Found BrewPi vL)sP on port /dev/ttyUSB0

Apr 15 2015 20:14:10 Warning: version number of local copy of logMessages.h does not match log version number received from controller.controller version = 0, local copy version = 1
Apr 15 2015 20:14:14 Cannot process line from controller: es\JID)s^JI)sP"JID9_aUC$NMksP9NM+)es\JINM+)es\JI
Apr 15 2015 20:14:16 Cannot process line from controller: _)ses_)s
C5a[AL
Apr 15 2015 20:14:16 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:16 Line received was: C")sP
C(FT	C$5FU
Apr 15 2015 20:14:20 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:20 Line received was: CNM
C"1FF	C$5FUBJI@9_NM+)es\JI
(FT	C$es_)sBJI@9_
Apr 15 2015 20:14:23 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:23 Line received was: C\^JI)sP
C(FMk	C$F	C5[H
CNMk	C$
C5UsP9FU
Apr 15 2015 20:14:29 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:29 Line received was: CNM
CNMIC$)JML)s^BJI
(FT
CUC$)FTk
C"5F
C5[ALsP9_B5a[AL
"FUJksTNMD[ANk$4FTHC$kesJML)s^BJIC$esk$JI)
Apr 15 2015 20:14:30 Cannot process line from controller: 
Apr 15 2015 20:14:32 Cannot process line from controller: _)sNML)sPFTJks\JMk$kes\JML)s
Apr 15 2015 20:14:34 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:34 Line received was: C\^JI)sP
CNMIC$)s"9JML)sJI@1F
Apr 15 2015 20:14:39 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:39 Line received was: C\^JI)sPNML)s\
CdC$esDa[ANkIiBJIBJI@9_)s
C"1F
C5Us"9s
"1FF	C$5aU
Apr 15 2015 20:14:40 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:40 Line received was: C\^BJI)sPJMD)s^BJI
CNMC$)k$JM
Apr 15 2015 20:14:42 JSON decode error: Expecting value: line 1 column 2 (char 1)
Apr 15 2015 20:14:42 Line received was: C
C5U
C5[AH
CNMk	C$FT)
Apr 15 2015 20:14:43 Cannot process line from controller: \JMs
C"1F
Apr 15 2015 20:14:43 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:43 Line received was: C")sFT+)
Apr 15 2015 20:14:44 Cannot process line from controller: \JMJML)sFT)
Apr 15 2015 20:14:45 Cannot process line from controller: \JM
Apr 15 2015 20:14:51 Cannot process line from controller: \^JH)sPs
"1FB5[AL
"
C"1F(FUH
CsP"9JI@1FJML)sDa[ANk$)FTHC$kesJID9_BJI@1FBJI@1F_k$JI)
Apr 15 2015 20:14:51 Cannot process line from controller: 
Apr 15 2015 20:14:52 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:52 Line received was: C\^JI)sP0[AL_k$JM
Apr 15 2015 20:14:53 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:53 Line received was: CkJMC$k$JM
Apr 15 2015 20:14:58 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:14:58 Line received was: C
C5FF	C$5aUkJMC$sP_9
CNMC$)
C5UJML)s^BJI)sP_9F	C$5aUBJI@1_FT)
Apr 15 2015 20:15:00 Cannot process line from controller: \JM
C5aUJML)s
C5UD[ANk$4FTH
Apr 15 2015 20:15:01 Cannot process line from controller: \_)sk$JI
Apr 15 2015 20:15:04 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:15:04 Line received was: CBJI@9_)s
"1FaUC$NMk
CNM	C$)UC$)FTkNML)sPk$JI)
Apr 15 2015 20:15:05 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:15:05 Line received was: CFTJksTNMk$JM
Apr 15 2015 20:15:05 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:15:05 Line received was: CaU
Apr 15 2015 20:15:07 JSON decode error: Expecting value: line 1 column 1 (char 0)
Apr 15 2015 20:15:07 Line received was: CNMFTJksTNMs
C"1F(FUR
C
Traceback (most recent call last):
File "/home/brewpi/brewpi8/brewpi.py", line 737, in 
ser.write("t") # request new from controller
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 518, in write
raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error
stdout:

This is where i pulled the arduino so i can wipe it and try again

something even weirder. i plugged this guy into my vm thinking i could try updating the firmware from there. and it seems to be running perfectly???

looks like my pi2 cant handle the power requirements of a wireless keyboard, a bt dongle, and 2 arduinos

looks like the data you’re getting over serial is completely garbled. power to the arduino and FTDI serial conversion could be a culprit there.

Did you set the USB port to output extra power? Please also measure it with a multimeter.

Regarding the permission error, please delete the downloads dir created by the older version of the updater.

PS: use 3 backticks above and below a log or code block to make it preformatted text:

Like this

I never changed any settings regarding power or anything relating to the pi configuration. I think the updater made changes to my config files even though I told it where to find each instance. I might try changing the output power of the pi. But for now I only use usb for uploading the hex files to my minions. Once updated they will all be back on BT serial. Which surprisingly has been quite rock solid for communication between the arduinos and the pi. I suspect its because none of them depend on the pi’s usb for power.