[SOLVED] RemoteCameraRobot not working

Dear all,

I am new to GoPiGO3 and trying out the RemoteCameraRobot project.

When I typed in “sudo python3 flask_server.py”, the message returned

Error : cannot import name 'Mutex
Error occurred: Make sure that you ran this program using python3!
Traceback (most recall call last):
File "flask_server.py",line 25, in <module>
gopigo3_robot - EasyGoPiGo3()
NameError: name 'EasyGoPiGo3' is not defined."

Any advice is greatly appreciated.

Thank you.

What happens when you run it without sudo? Perhaps the root user doesn’t have access to the EasyGoPiGo?

Can you run other GoPiGo example code? Maybe something more basic?

Hello @tktham

It seems something went wrong with the installation. What OS are you using. Is it Raspbian for Robots, or Raspbian?

Cleo

Hi Cleoqc,

I am using Raspbian for Robots OS.

Thank you.

Hi graykevinb,

I can run the BasicRobotControl project with no issue, but not flask_server.py.

Thank you.

Hi @tktham,

flask_server.py runs with Python 3, whereas BasicRobotControl project can be run with Python 2.

You could check the availability of this module by trying to import it (the easygopigo3 module) in Python 2 & 3 - theoretically, it should fail for Python 3. Judging the error message you got, I think it’s because you have an older version of the gopigo3 package.

In either case, after you check the availability of the module, you should run the following command:

sudo sh -c "curl -kL dexterindustries.com/update_gopigo3 | bash"

This will install the GoPiGo3’s deps again and then please let us know if the problem still persists.

Thank you!

Dear RobertLucian,

My version is Python 2.7.9 [GCC 4.9.2] on linux2.

There was no error message when I “import easygopigo3”.

I have also executed the following command and performed a reboot:
sudo sh -c “curl -kL dexterindustries.com/update_gopigo3 | bash”

If I read the recommendations, is it correct that flash_server.py can only be run with Python 3? If so, how do I upgrade my version of Python 2 to Python 3?

Many thanks again!

Dear RoberLucian,

This is a screenshot of the test, thank you for any advice.

image

This is my Python 3 version :slight_smile:
image

Hi @tktham,

I’ve been testing this and I think you hadn’t run the install.sh script.
Here’s the description in the README of what you should do:

Please let me know if that makes yours work.

Thank you!

I am currently having the same issue. I am receiving the error shown below:

Error : cannot import name 'Mutex
Error occurred: Make sure that you ran this program using python3!
Traceback (most recall call last):
File “flask_server.py”,line 25, in
gopigo3_robot - EasyGoPiGo3()
NameError: name ‘EasyGoPiGo3’ is not defined."

I have followed the steps in this forum but to no avail.

I have first run the “sudo bash install.sh”.

Rebooted the computer.

Then attempted to execute “sudo python3 flask_server.py” but received the same error in this forum.

I attempted to run without “sudo” but got the same response.

I ran “sudo sh -c “curl -kL dexterindustries.com/update_gopigo3 | bash”” and rebooted the Raspberry Pi but still get the same error.

Any further assistance would be greatly appreciated. This is a project that I was quite excited about to implement.

Sincerely,

Kevin Gaughan

Hi @kevin.gaughan1990,

There were a couple bugs we found and we have fixed them.

What I would ask you to do is to run the following commands in the following order:

curl -kL dexterindustries.com/update_gopigo | sudo bash
curl -kL dexterindustries.com/update_gopigo3 | sudo bash

And then run the flask_server.py and tell us if this did the job for you. It did for me.

Thank you!

Dear Robert,

Unfortunately, the same error occurs even after the updates.

Is it possible to show a step by step resolution?

Thank you.

Hi @tktham,

I would do the following:

sudo pip3 uninstall gopigo

After you run this command, give flask_server.py another shot and let me know if it starts working again. This will leave you with no API to interface with the old GoPiGo, but this is not the case as you have a GoPiGo3.

And if it still doesn’t work, please leave here the output of pip3 list command.

Thank you!

Dear Robert,

It is finally working!

I also had to open a new browser and go to http://dex.local:5000 once I rebooted the GoPiGo3.

Thank you once again for the persistent follow up and help! Excellent support!

1 Like

Hi @tktham,

I’m glad it now works.
And hope you like driving the robot around with a camera on top of it :wink:

If there’s anything else to talk about, please let us know.

Thank you!