Motor Test not running

I have installed the image of Raspbian OS as per the instructions and when I tried to test the motors. the following error is appearing:

pi@raspi001:~ $ python
Traceback (most recent call last):
  File "", line 7, in <module>
  File "build/bdist.linux-armv7l/egg/", line 492,
     in BrickPiSetupSensors
  File "build/bdist.linux-armv7l/egg/", line 698,
     in BrickPiFlush
  File "/usr/lib/python2.7/dist-packages/serial/",
     line 572, in inWaiting
    return self.in_waiting
  File "/usr/lib/python2.7/dist-packages/serial/",
     line 456, in in_waiting
    s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
IOError: [Errno 25] Inappropriate ioctl for device

Don’t know what to do please help

Hi @sumanth.gokapai,

This is a duplicate of:

With that being said, I’ll still leave this thread open.

The error above indicates you are trying to use BrickPi/BrickPi+ code. If you are using BrickPi3, you need to use BrickPi3 code.

Thanks @Matt
The Brickpi3 is connected to Raspberry Pi 3 model B+ and working fine.
But I have a problem the motor is not running.
I mean when I connected to the board I am getting the encoder positions and the encoder position is changing when I manually rotate the motor.
But when I want the motor to move by command rather than manually its not moving .

Try connecting batteries and turning on the power switch. Go to this page and read the section labeled “Batteries and Power” to learn about the power requirements of the BrickPi3. On that same page, you can also read the section titled “LEDs” to learn how you can determine battery voltage by looking at the flashing yellow LED.

I have seen the webpage and my Yellow LED is blinking rapidly(may be 4 times )per second.
But I am using 8*1.5V batteries (new)
I ran a program to see the voltages and the output says
Battery Voltage : 4.437
9V Voltage : 9.009 etc
But the strange thing is that no reading is changing even I disconnected the batteries. The readings are still saying : Battery Voltage : 4.437
9V Voltage : 9.009 etc
I am powering the RPi 3 model B+ with the adapter which comes with it

The above indicates that it’s not getting power from the batteries. That (roughly) 4.4v should be more like 10v (maybe 12v, if you’re using alkaline cells). Is the power switch in the “ON” position? With the batteries as the only power source (USB disconnected) does the BrickPi3 and RPi still power on?

BTW, the 9v voltage is boosted from the 5v rail, and is always expected to be 9v when running, regardless of the battery voltage.

Thanks @Matt for the reply,

  1. Yes, the power switch is in “ON” position,
  2. No, when the batteries are as only power source (USB Disconnected), the BrickPi3 and RPi are not ON, no LED is lightning on either.

Can you double check you batteries? Make sure they aren’t dead, and make sure they are oriented correctly. You could also check the battery cable, to be sure it is connected fully to both the battery pack and the BrickPi3.

Do you have a volt meter or multi-meter available?

Yeah the batteries are new and never used before. Regarding the orientation, I have checked them again and again to make sure that they are oriented properly. Cable seems fine to me because brickPi and all accessories came with are quite new.
Regarding Voltmeter or Multimeter, I don’t have one right now and I’ll try to check the voltage and let you know.
Thanks for assisting.

I have measured the voltage of the Battery Pack (8*1.5V) and it is giving voltage about 12.98V which concludes that the batteries are charged enough. So, the problem now is only about the cable or the port on Brick Pi3 board.
But the cable looks fine to me without any twists, abrasions etc.
Please let me know what to do next.

Try testing the following points. Connect the - lead of the volt meter to the green point, and the + lead of the meter to the red point. With the battery pack plugged in and the power switch in the “OFF” position, you should be measuring about 12v (battery voltage) across the green/red points. If you are not seeing the battery voltage across those two points, you probably have a defective battery cable, or possibly a defective power jack.

If you are able to read the expected 12v across green/red, try measuring across green/orange with the power switch in the “ON” position. It should be close to the battery voltage, but maybe 0.2v less.


Thanks @Matt
I have tried measuring the voltage between the points as you said and I observed :

  1. Between Red and Green (OFF Position), the volt meter reads 0.02V
  2. Between Green and Orange (ON Position), the voltmeter reads 0.00V

As you said it might be the defective battery cable or possibly a defective power jack. I have another cable not with me but I can bring that over the weekend and update you.

Thanks for your support.

Hi @Matt,
I have tried it with another cable and it worked. So the problem is with the cable I guess.
Is there a way that so guys can send me another cable??


Thank you for testing and reporting back. I will ask @ChrisDooley to send you a new battery cable.

@sumanth.gokapai I sent you a direct email requesting your contact information. Once I have this, I will be happy to send you a new cable.

@Matt I have a small problem, I was trying to run BP.detect(); thorugh multiple files but it’s giving me so many errors. Can you please look at this
I have created three files which I have attached below and tried to compile it but I’m getting a huge error!! I have included the error text in the file “execute.txt”.
Please go through this and help me
For some specific reason I want to run through multiple files
run.cpp (44 Bytes)
execute.txt (9.9 KB)
test.cpp (77 Bytes)
test.h (98 Bytes)

What command arguments are you using to compile?

I think your file structure and #include statements need adjusting. Like the examples, try compiling with a single file of user code. Once that’s working, expanding your code to multiple files would be a C/C++ related issue, not a BrickPi3 issue.

Yeah, I thought it was a C++ issue but if I didn’t include #include “BrickPi3.h” it was working fine and the error is popping up only when I include BrickPi3.h
I’ll double check and but I’m sure that it’s only popping up when I am dealing with BrickPi3
Anyway, if you have any info please let me know.

It could really help to know what command arguments you’re using for compiling.