IOError When Entering Command


#1

We get to the point with our robot where everything is set up correctly - we’re using an external robot but using Dexter Industries code to do so.

We get to the point where you can enter a command into the robot to make it move, the code runs fine once you’ve used sudo basic_robot.py.

The problem is, once we enter the command and press enter
the next line that shows is “IOError”. We can’t really figure out what this is.

Any ideas?


#2

This also happens when doing the Basic_test_all.py
The commands just send back IOError, therefore not working. ??


#3

Hey,
Can you post the error output that you see on the screen.

-Karan


#4

That’s the thing…

It’s
"Enter a Command: W "
“IOError”
“Enter a Command: A”
“IOError”
“Enter a Command: D”
“IOError”

This is with the motors plugged in and taking them out, they both receive the same error.


#5

Just to clarify, I’m using a Raspberry Pi system with pretty much the exact same motor, mini driver and robot base. It’s using the same code and everything else, though, so I can’t imagine it being a problem with any sort of modules or anything like that.


#6

Hey wolfgroup, this made it a little less clear! :slight_smile: Just to be clear:

  • Are you using a Raspberry Pi or a Pi clone? What exactly are you using for your Pi?
  • Are you using the GoPiGo or a clone or a diy version? (Confused because you said you’re using "much the exact same motor . . . " meaning you’re not using the GoPiGo?)

Thanks!


#7

We’re not using the GoPiGo machine specifically, we’re using a robot we built ourselves, but with the same components as a GoPiGo (If we knew, we would’ve gotten one of those instead of doing it manually). We’re using a pi.

In effect, we’re basically using everything a GoPiGo is, except it’s not your machine, we also don’t have an SD card with the things preloaded, hence the errors possibly?

I think everything is fine, but it’s just something to do with the IOError itself.


#8

Ok, understand. First, I would be amiss if I didn’t recommend buying the GoPiGo. It’s a steal!

Ok, I there may be a hardware error here. Do you have a way to check that serial data is moving back and forth, like a Salae Logic Analyzer for example?

The most common thing we see is that with a Kernel upgrade, you might get a python serial error. However, it seems you’re not getting that.

Just checking though, you’re using Python 2.7?


#9

Just adding a bit on what John just wrote, can you run i2cdetect -y 1 on and see if you get anything on address 08. If you do not, then it might be a firmware issue. Can you check if you have the proper firmware installed and the I2C lines connected since you are not using the GoPiGo board.

-Karan


#10

We will get a GoPiGo eventually, we’re just kind of trying to do this to meet a deadline, first! But we will, I can assure you.

I type
sudo python2.7 basic_robot.py

“This is a basic example for the GoPiGo Robot Control
Press:
//Controls”

Enter a command: W 
IOError

Yeah, you’re right, there isn’t anything on address 08. Is there a specified firmware I need to have, could you possibly link it?

I’ve done the Config modification to the I2C from a previous thread, that didn’t really do much.

The code I used for the I2C checking was

sudo su - 
root@raspberrypi:-# i2cdetect -y 1 

and brought nothing back on address 08.

This is without the motors connected, and it still returns the IOError even when they are connected…

Thanks for your help, I really appreciate your time!


#11

Yeah, so we’re not entirely sure on where to go next.

Any help is greatly appreciated.


#12

Are you using an atmega microcontroller on the pcb? Maybe you can post a picture.

It sounds like you haven’t uploaded the GoPiGo firmware? You can find it on our github site for the GoPiGo.


#13

We’ve got everything the GoPiGo contains, there’s GoPiGo firmware?


#14

Could you please help me on installing the firmware, not entirely sure how with a Raspberry Pi. Thanks.


#15

Hey,
GoPiGo is an addon board for the Raspberry Pi. The GoPiGo has a MCU (an ATMEGA328) for fetching and executing commands from the Raspberry Pi and a motor controller to control the motors and a couple of other things.

So basically, the Raspberry Pi sends commands to the GoPiGo board and the firmware on the GoPiGo board decides what to do with the commands and run either the motors or do something else. So you need a MCU similar to the one on the GoPiGo to use it.

Can you tell us what hardware you are using and how you are planning to use the GoPiGo with it.

-Karan


#16

It is a
Raspberry Pi
Dagu Arduino Mini Driver Board
Dagu Robot Base with Motors
and then the essential power things.

We assume we can use the GoPiGo code with it, or the code to power it.


#17

Hey,
If this is the board that you are talking about http://www.dagurobot.com/goods.php?id=142 then I am not sure if it would work or not. The reasons being that GoPiGo uses Atmega328 whereas the Dagu one uses Atmega8. The 328 has more RAM and Flash and the GoPiGo firmware is written according to that. At the very least, you would have to recompile the firmware for Atmega8 and see if it works.
Also, you would have to check if the pins are compatible or not, because the Pins on the ATMEGA328 on the GoPiGo have a specific function and it might not be hte same on the Dagu board.

Last, looks like the board used USB for communication whereas the GoPiGo uses I2C directly from the Raspberry Pi.

I am sorry to say but it would be very difficult to get the Dagu board to work with the GoPiGo firmware.

-Karan