GoPiGo3 easy_distance_sensor.oy error

I tried to run the gopigo3 easy_distance_sensor.py program but i get the following error
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/pi/Dexter/GoPiGo3/Software/Python/Examples/easy_Distance_Sensor.py”, line 39, in
gpg = easy.EasyGoPiGo3()
File “/usr/local/lib/python3.5/dist-packages/gopigo3-1.3.0-py3.5.egg/easygopigo3.py”, line 112, in init
raise e
File “/usr/local/lib/python3.5/dist-packages/gopigo3-1.3.0-py3.5.egg/easygopigo3.py”, line 109, in init
super().init(config_file_path=config_file_path)
File “/usr/local/lib/python3.5/dist-packages/gopigo3-1.3.0-py3.5.egg/gopigo3.py”, line 242, in init
raise IOError(“No SPI response. GoPiGo3 with address %d not connected.” % addr)
OSError: No SPI response. GoPiGo3 with address 8 not connected.

3 Likes

Please post what the following return:

whoami

cat /etc/os-release

uname -a

grep dtparam /boot/config.txt

groups

ls ~/Dexter

more ~/Dexter/Version   (file may not be found)

more /opt/Sam_Dev/webapp/version.txt   (file may not be found)

more ~/Dexter/gpg3_config.json   (file may not be found)
2 Likes

whoami - pi
PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
VERSION_CODENAME=stretch
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“RaspbianForums - Raspbian

uname -a
Linux kitt 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

grep dtparam /boot/config.txt
#dtparam=i2s=on
dtparam=audio=on
dtparam=i2c1=on
dtparam=i2c1=on
dtparam=i2c1=on
dtparam=i2c1=on
dtparam=i2c1=on
dtparam=i2c1=on
dtparam=spi=on
dtparam=i2c_arm=on
dtparam=i2c1=on
dtparam=i2c_arm=on

groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi

ls ~/Dexter
black_line.txt DI_Sensors GrovePi range_line.txt white_line.txt
BrickPi3 GoPiGo lib update_master.sh
detected_robot.txt GoPiGo3 PivotPi Version

more ~/Dexter/Version
V 10
This version of Raspbian was modified by Modular Robotics on the Stretch Raspbia
n Build.
This version was updated on 17th of October 2020.
#############
Start: Sat Oct 30 17:24:24 EDT 2021
End: Sat Oct 30 17:29:21 EDT 2021

2 Likes

This error is saying the Raspberry Pi is not “seeing” the GoPiGo3 robot, so is it possible for you to take a photograph of the 40 pin connector between the red GoPiGo3 board and the Raspberry Pi board?

This is mine:

It is somewhat easy to get a bent pin or to misalign the connector

2 Likes

While the version of the OS should not be causing the Raspberry Pi to not see the GoPiGo3 board, your version is quite old. I think ModRobotics may want to support you on their latest OS - GoPiGo OS, which you can get at

By the way, official support from Modular Robotics is by email: support@modrobotics.com

2 Likes

Though correct in the absolute sense, I do not recommend that as a first-line support option because:

  1. The folks at MR are incredibly busy at the moment, and their ability to provide a timely response may be limited.

    • This has been confirmed in emails to me by both Nicole and Mitch.
       
  2. Though available to everyone, it is (IMHO) primarily intended for “institutional” or “business” clients who think that forums are beneith their dignity.

  3. There is a large enough body of knowledge here that we can provide a very effective first-line support system, taking much of the load off of them, allowing them to concentrate on more important things, like software/OS updates. :wink:

  4. Answers posted, (and answered), here are visible to everyone and will show up on search engine results.  E-mail answers aren’t/won’t.

As a result, I respectfully disagree with the idea of redirecting people to the support e-mail as a general thing.

@cleoqc @mitch.kremm
Please confirm or disagree.

IMHO, we provide a distinct service that conserves everyone’s time at MR for more important things, and the more thorny/technical issues.

What say ye?

1 Like

That depends on the Raspberry Pi itself.

@sigdelanubhav,
Which version of the Pi are you using?

Does the power light stop blinking and stay solid green?

Does the antenna LED light? (It should be yellowish in color.

I absolutely agree with @cyclicalobsessive in that this version of the operating system is both old and depreciated.

The best and easiest way to get your 'bot working is with GoPiGo OS 3.0.1.  it is the latest and best Dexter/MR operating system.

Note that there are only two “supported” operating system configurations at this point:

  • GoPiGo OS.
  • Raspbian/Raspberry Pi OS with the latest libraries installed.
    • Note that this is for the more advanced user who needs capabilities that GoPiGo OS cannot provide.
1 Like

PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
VERSION_CODENAME=stretch
ID=raspbian
ID_LIKE=debian

Yes

Yes

I have updated the GoPiGo and Dexter operating system,

3 Likes

“What Pi are you running” = Which version of the Raspberry Pi are you using?  A Pi-3B?  A Pi-4?

What exactly did you upgrade?
The GoPiGo robot itself?

What is the formal name of the operating system?  Dexter OS?  Raspbian for Robots?

Is it working now?

One other important question:
What brand of SD card are you using?

The later versions of the actual Raspberry Pi itself are very sensitive to the quality of the SD card.

Inexpensive SD cards almost always do not work well.  If they work well today, they may cause problems tomorrow.

I only use SD cards manufactured by SanDisk or Toshiba.  Other brands, like PNY, Kingston, or inexpensive bargain brands, have never worked well for me.

Where are you located?
Here in Moscow Russia, there are a lot of discount brands like “Good Buy”, “Prestige”, and others like that, and they don’t work well.

2 Likes

I have been able to duplicate this issue by updating my copy of GoPiGo OS.

What appears to be happening is that the pigpiod service starts, but is then killed somehow resulting in the GoPiGo PCB to become inaccessible until you run sudo pigpiod.

Re-enabling the service isn’t “sticky”

In my case the service is apparently running at startup because Charlie’s “shake head” script runs.  However, after the system fully starts, the service fails/is stopped for whatever reason.

The only way to regain control of the bot is the “sudo pigpiod” command noted above.

2 Likes

While we are indeed busy, customer support is a priority for us. So please do bring your problem to the team by emailing us at support@modrobotics.com

Folks in here are incredibly knowledgeable and willing to help, and you may have faster answers although we do try to follow up on support email within 24 hours.

3 Likes

What are your replication steps?

2 Likes

@cleoqc,

Steps to reproduce:

  1. Start with a working installation of GPGOS 3.0.0. (I am in the process of upgrading to 3.0.1.)

  2. From a root terminal, run:

apt-get upgrade

apt-get update
  1. There are two places where you are given an option to either update a config or not.

    • I answered “yes” and allowed the package maintainers version to install.
  2. Reboot.

Expected result:

  1. Everything is fine.

Actual result:

  1. On startup, GoPiGo libraries are available and apparently pigpiod is running, because my startup scripts (that run as a startup job in the system crontab), execute normally.

  2. After the system is completely ready, (desktop available on an attached monitor and WiFi connected as networked WiFi), none of the GoPiGo functionality is available until you run sudo pigpiod. In any event, the antenna LED never lights.

I tried running “system disable” and then “system enable” for the pigpiod service to re-create the enabling symlink.  No good, as it never survives a reboot.

I am thoroughly confused as to why the pigpiod service dies. Apparently something is killing it and I can’t find a reason why - not even in the log files.

2 Likes

Update:

I discovered a command

apt list --upgradable

That produces a list of everything that is “up for grabs” as far as updates are concerned, in this case a total of 291 packages.

Looking at the list, there are a few packages that stand out as candidates:

  • pigpio-tools/testing 1.79-1+rpt1 armhf [upgradable from: 1.71-0~rpt1]
  • pigpio/testing 1.79-1+rpt1 armhf [upgradable from: 1.71-0~rpt1]
  • pigpiod/testing 1.79-1+rpt1 armhf [upgradable from: 1.71-0~rpt1]

. . . . with pigpiod being the most likely suspect.

What I am going to try is an rsync of my 3.0.1 installation, apply each update in turn, and see which one boffs the system.

2 Likes

Update:

Success!

After learning much about rsync, I was able to finally try this on my installation of GoPiGo OS 3.0.1

Verdict:
Updating pigpiod causes robot functionality to fail.

Details:
Updating pigpiod causes a number of other pigpio packages, and several associated libraries, to be updated as well.

Viz.:

root@Charlie:/home/pi# apt-get install pigpiod
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libpigpio-dev libpigpio1 libpigpiod-if-dev libpigpiod-if1 libpigpiod-if2-1
  pigpio pigpio-tools
The following packages will be upgraded:
  libpigpio-dev libpigpio1 libpigpiod-if-dev libpigpiod-if1 libpigpiod-if2-1
  pigpio pigpio-tools pigpiod
8 upgraded, 0 newly installed, 0 to remove and 283 not upgraded.
Need to get 348 kB of archives.
After this operation, 21.5 kB of additional disk space will be used.
Do you want to continue? [Y/n] 

 

Trying to run the control panel script from the command line errors out like this:

pi@Charlie:~ $ python2 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/Control_Panel/control_panel_gui_3.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Can't connect to pigpio at localhost(8888)

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi('soft', 8888)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GoPiGo3 cannot be instanstiated. Most likely wrong firmware version
'NoneType' object has no attribute 'send'
pi@Charlie:~ $ 

It appears that, for whatever reason, the pigpiod daemon is NOT running.

Time to investigate the logs. . . .
 

======================

Adding to this because I cannot add a third comment.

Viz.:

@cleoqc

Log data attached.

Notes:

Line 156:

Nov  9 01:49:56 Charlie systemd[1]: Starting Daemon required to control GPIO pins via pigpio...

Line 170:

Nov  9 01:49:56 Charlie pigpiod[500]: 2021-11-09 01:49:56 initInitialise: bind to port 8888 failed (Cannot assign requested address)

Line 187:

Nov  9 01:49:56 Charlie systemd[1]: Started Daemon required to control GPIO pins via pigpio.

Lines 195 - 197:

Nov  9 01:49:57 Charlie pigpiod[500]: Can't initialise pigpio library
Nov  9 01:49:57 Charlie systemd[1]: pigpiod.service: Main process exited, code=exited, status=1/FAILURE
Nov  9 01:49:57 Charlie systemd[1]: pigpiod.service: Failed with result 'exit-code'.

Lines 242 - 259:

Nov  9 01:49:58 Charlie python3[508]: autodetect
Nov  9 01:49:58 Charlie python3[508]: Cleaning SPI
Nov  9 01:49:58 Charlie python3[508]: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Nov  9 01:49:58 Charlie python3[508]: Can't connect to pigpio at localhost(8888)
Nov  9 01:49:58 Charlie python3[508]: Did you start the pigpio daemon? E.g. sudo pigpiod
Nov  9 01:49:58 Charlie python3[508]: Did you specify the correct Pi host/port in the environment
Nov  9 01:49:58 Charlie python3[508]: variables PIGPIO_ADDR/PIGPIO_PORT?
Nov  9 01:49:58 Charlie python3[508]: E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888
Nov  9 01:49:58 Charlie python3[508]: Did you specify the correct Pi host/port in the
Nov  9 01:49:58 Charlie python3[508]: pigpio.pi() function? E.g. pigpio.pi('soft', 8888)
Nov  9 01:49:58 Charlie python3[508]: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Nov  9 01:49:58 Charlie python3[508]: P is <pipio.pi host=localhost port=8888>
Nov  9 01:49:58 Charlie python3[508]: 'NoneType' object has no attribute 'send'
Nov  9 01:49:58 Charlie python3[508]: Exception caught
Nov  9 01:49:58 Charlie python3[508]: Detecting GoPiGo
Nov  9 01:49:58 Charlie python3[508]: Found GoPiGo
Nov  9 01:49:58 Charlie python3[508]: Found GoPiGo.
Nov  9 01:49:58 Charlie python3[508]: run_autodetect/ Detected robot: GoPiGo

Attaching copy of daemon.log:
Daemon_log.txt (72.7 KB)

Other logs do not appear interesting.

Even with the daemon running manually, the GoPiGo web page shows no robot detected.

Viz.:

 
 


 

What say ye?

========================

Update:

@cleoqc,
Installing all available updates EXCEPT pigpio, pigpio-tools, pigpiod and their dependent libraries does NOT break the GoPiGo OS 3.0.1.

Therefore, one of these packages, or one of the dependent libraries, is the culprit.

1 Like