[Solved] Unable to connect to controller, perhaps it is disconnected or otherwise unavailable

I have my RaspberryPi 2 setup and working and now trying to connect my BrewPi Spark to it via USB and run the updater script but I continue to get the “Unable to connect to controller, perhaps it is disconnected or otherwise unavailable.” message when doing so. I saw the Software Installer Guide thread where someone had a similar issue and replaced the USB cable, so I tried that and still no luck. Can anyone help?

Here is what I get when I run updater.py.

$ sudo ~/brewpi-tools/updater.py
######################################################

Welcome to the BrewPi Updater!

######################################################

Checking whether the update script is up to date
/home/pi/brewpi-tools is up-to-date.

*** Updating BrewPi script repository ***

Stopping running instances of BrewPi
[Errno 2] No such file or directory
Could not connect to socket of BrewPi process, maybe it just started and is not listening yet.
Could not send quit message to BrewPi instance with pid 22702!
Killing it instead!
SIGKILL sent to BrewPi instance with pid 22702!
You are on branch master
The latest commit in /home/brewpi is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 17:15:44
The latest commit on origin/master is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 17:15:44
Your local version of /home/brewpi is up to date!

*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17:59:39
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…
[Errno 2] No such file or directory
Could not connect to socket of BrewPi process, maybe it just started and is not listening yet.
Could not send quit message to BrewPi instance with pid 22711!
Killing it instead!
SIGKILL sent to BrewPi instance with pid 22711!

Checking current firmware version…
Oct 29 2015 01:09:11 Opening serial port
Oct 29 2015 01:09:21 Errors while opening serial port:
Could not find compatible serial devices

Unable to connect to controller, perhaps it is disconnected or otherwise unavailable.

*** Done updating BrewPi! ***

Here is what I get when I run autoSerial.py.

$ python /home/brewpi/autoSerial.py
All ports: ()
Compatible ports: ()
Selected port: (None, None)

Based on previous cases I have solved, it is either:

  • The power supply to the pi.
  • Still the USB cable, try a another one, make sure the connector is inserted deep enough. It is possible for the power pins to connect without the data pins making good contact.

I’m having the same issue. Should the spark be able to be powered from the USB port alone? If so, I think my spark has a defective USB connector. I can turn it on with the separate power supply, the hardware test firmware loads up and recognizes temperature probes and controls SSRs, but I can’t get it to connect to any device. I’ve tried linux, RPi 2, and a windows machine. I can’t power it through the USB port alone.

This could be the case. I have seen it that where the plastic thingy inside the USB connector is a bit loose or even comes off. I will take the issue up with Particle. I think they need to switch to a higher quality USB connector on the Photon.

Can you check your USB connector for abnormalities? Then I can send you a new photon to get this sorted.

It looks like the plastic thingy isn’t even there inside my USB connector. Here are some photos of the port

Yeah that looks bad. It one had a working USB connector, because I used it for initial programming. It should not break off though. PM me your address or order number and I will ship you a new Photon.

Ok, I just got a new Photon in place and now I get a response back from the serial (see below), however its still not able to see the controller and I get the “Unable to connect to controller, perhaps it is disconnected or otherwise unavailable.” message back when running updater.py. I have the micro USB cable in snug, but I don’t want to push too hard and risk breaking the Photon. What am I doing wrong?

python /home/brewpi/autoSerial.py
All ports: ((’/dev/ttyACM0’, ‘ttyACM0’, ‘USB VID:PID=2b04:c006 SNR=00000000050C’),)
Compatible ports: ((’/dev/ttyACM0’, ‘Particle Photon’),)
Selected port: (’/dev/ttyACM0’, ‘Particle Photon’)

Just tried several other USB cables, same results for everything. Here is my full command/results.

$ sudo ~/brewpi-tools/updater.py
######################################################

Welcome to the BrewPi Updater!

######################################################

Checking whether the update script is up to date
/home/pi/brewpi-tools is up-to-date.

*** Updating BrewPi script repository ***

Stopping running instances of BrewPi
Quit message sent to BrewPi instance with pid 2954!
You are on branch master
The latest commit in /home/brewpi is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 17:15:44
The latest commit on origin/master is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 17:15:44
Your local version of /home/brewpi is up to date!

*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17:59:39
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…
Nov 09 2015 22:23:44 Opening serial port
Unable to connect to controller, perhaps it is disconnected or otherwise unavailable.

*** Done updating BrewPi! ***

I helped Denny offline. This was all caused by not running dfu-util or updater.py with sudo.

Hello, I am having the exactly same issue. Can someone go into a little detail on the fix? Thanks!

If you are using an Arduino, use xloader (http://www.hobbytronics.co.uk/arduino-xloader) to upload the hex file for the first time.

If you are not using an Arduino, please post a copy of your log file.

I am having this issue and I wonder if my device is bricked. I bought your Spark unit, followed the updater.py directions and afterwards I just get a white screen.

It sounds like something went wrong during the firmware update.
It is probably blinking blue, because it is now running the default blink program that comes with the standard spark firmware. If it is not blinking blue, what color is the LED?

Can you put it in DFU mode by holding the setup button while you plug in the USB cable? After holding the button for 5 seconds, it should start blinking yellow.
Then run:

cd /home/brewpi/script/utils
sudo python flashDfu.py
1 Like

Thanks - worked like a charm.

I was having the same issue but flashDfu.py didn’t seem to work for me. Here is what I get:

pi@raspberrypi:~ $ sudo python /home/brewpi/utils/flashDfu.py
Using dfu-util binary at /home/brewpi/utils/downloads/dfu-util
Detecting DFU devices
Found 1 devices: [‘2b04:d006’]
Device identified as Particle Photon
Downloading latest firmware…
Latest stable version on GitHub: 0.4.2
downloading https://github.com/BrewPi/firmware/releases/download/0.4.2/brewpi-0.4.2-photon.bin
Firmware downloaded to /home/brewpi/utils/downloads/0.4.2/brewpi-0.4.2-photon.bin
Updated system firmware for the photon found in release 0.4.0
downloading https://github.com/BrewPi/firmware/releases/download/0.4.0/system-part1-0.4.7-photon.bin
downloading https://github.com/BrewPi/firmware/releases/download/0.4.0/system-part2-0.4.7-photon.bin
Downloaded new system firmware to:

/home/brewpi/utils/downloads/0.4.0/system-part1-0.4.7-photon.bin and

/home/brewpi/utils/downloads/0.4.0/system-part2-0.4.7-photon.bin

First updating system firmware for the Photon, part 1: /home/brewpi/utils/downloads/0.4.0/system-part1-0.4.7-photon.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08020000, size = 249740

File downloaded successfully
Continuing updating system firmware for the Photon, part 2: /home/brewpi/utils/downloads/0.4.0/system-part2-0.4.7-photon.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuDNLOAD-IDLE, status = 0
aborting previous incomplete transfer
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08060000, size = 169832

File downloaded successfully
Now writing BrewPi firmware /home/brewpi/utils/downloads/0.4.2/brewpi-0.4.2-photon.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuDNLOAD-IDLE, status = 0
aborting previous incomplete transfer
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x080a0000, size = 85376

File downloaded successfully
Programming done
Now resetting EEPROM to defaults
Opening serial port
Mar 14 2016 00:43:49 Opening serial port

And then it just hangs there. Here is what I get from autoSerial.py:

pi@raspberrypi:~ $ sudo python /home/brewpi/autoSerial.py
All ports:
/dev/ttyACM0 - Photon with WiFi, VID:2b04, PID:c006
/dev/ttyAMA0 - ttyAMA0, VID:None, PID:None
Compatible ports:
(’/dev/ttyACM0’, ‘Particle Photon’)
Selected port: (’/dev/ttyACM0’, ‘Particle Photon’)

Any advice?

That’s strange. It looks like the firmware update completed without any issues.
Do you hear 2 beeps at startup? what is on the display?

I don’t actually have a display. I’m piecing this together from the components.

The Photon’s LED does change from blinking yellow to a “breathing” white or light blue light.

Oh, and I haven’t heard any beeps. Would it be the Photon beeping?

Maybe you should have mentioned that in your first post.
Then my best guess is that it is hanging on initialization of the OneWire bus master.
The buzzer is part of the BrewPi shield, so you don’t have one.

So the flash is working fine, you are missing bits of hardware BrewPi depends upon. I am selling shields with nice connectors, a display, buzzer, bus masters, etc. is because I supported DIY builds with Arduino and it took up all my time. I was busier helping people debug their custom builds than actually moving the software forward.

Going with good interface ICs and quality connectors got rid of 95% of all OneWire related problems. I don’t want to go back.
If you want to go with a non-standard BrewPi build, I suggest you buy an in-circuit debugger to find out where the code is hanging. You are also on your own, I’m sorry.