So I think I should power up the hub. I found that when the USB hub is power, the RPi TP2 no longer drops so much, this time only to 5.01V when power supply is 5.3V.
But I still got the following error message.
SystemError: ioctl(VIDIOC_S_FMT) failure: no supported formats
Next step is to check out the cause of this error.
*** Start Program - FongToy v1.7 tlfong01 2013jun10 ***
*** Sample run begin - Test web cam 2013jun11 ***
List of available cameras = ['/dev/video0']
Traceback (most recent call last):
File "fongtoy.py", line 77, in <module>
ftwebcam.TestWebcam()
File "/home/pi/fongtoy/ftwebcam.py", line 44, in TestWebcam
webCam.start()
SystemError: ioctl(VIDIOC_S_FMT) failure: no supported formats
pi@raspberrypi ~/fongtoy $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0586:341f ZyXEL Communications Corp. NWD2205 802.11n Wireless N Adapter [Realtek RTL8192CU]
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 006: ID 046d:0825 Logitech, Inc. Webcam C270
pi@raspberrypi ~/fongtoy $ date
Tue Jun 11 02:56:47 UTC 2013
pi@raspberrypi ~/fongtoy $
# ftwebcam v0.2 tlfong01 2013jun11
# *****************************************************************************
# Module - ftwebcam.py
# Description - Test Logitech webcam C920 and C270
# Reference
# Pygame.camera Reference - http://www.pygame.org/docs/ref/camera.html
# Pygame.camera Turorial - http://www.pygame.org/docs/tut/camera/CameraIntro.html
# Notes
# Image zise 2MP 16:9 = 1920 * 1080 = 2,073,600
# *****************************************************************************
# *****************************************************************************
# Imports
# *****************************************************************************
import time
import pygame
import pygame.camera
from pygame.locals import *
import ftprint
# *****************************************************************************
# Function - TestWebcam()
# Description -
# Test Webcam
# *****************************************************************************
def TestWebcam():
ftprint.PrintDoubleSpaceLine("*** Sample run begin - Test web cam 2013jun11 ***")
pygame.init()
pygame.camera.init()
webCamList = pygame.camera.list_cameras()
if webCamList:
print "List of available cameras = ", webCamList
webCam = pygame.camera.Camera(webCamList[0],(640,480))
webCam = pygame.camera.Camera("/dev/video0",(640,480))
webCam.start()
webCamImage = webCam.get_image()
ftprint.PrintDoubleSpaceLine("*** Sample run end ***")
# .END
# *** Main program ***
# *** Start program message ***
ftprint.StartProgram(ProgramTitle)
# *** Main tests ***
# *** SPI loop back ***
# ftspi.TestSpiLoopBackV01(spiChannelNumber = 0, spiChipEnableNumber = 1, testDataByte = 0x55, testTime = 0.001, testCount = 60000)
# *** ADC ***
# ftadc.TestMcp3208v03()
# ftadc.TestMcp3201v04()
# *** EEPROM ***
# fteeprom.TestEeporm25Lc256v01(spiChannelNumber = 0, spiChipEnableNumber = 1, startAddress = 0x4100, testDataByte = 0x55)
# *** Mcp23s17 ***
# ftiox.TestMcp23s17BlinkLed(spiChannelNumber = 0, spiChipEnableNumber = 0, spiChipSubAddress = 0)
# *** Demux ***
# ftdemux.TestDemuxV01(spiChannelNumber = 0, spiChipEnableNumber = 0, spiIoxSubAddress = 0, spiSlaveDeviceNumber = 5)
# *** Guzunty Pi Step Motor ***
# ... test functions already moved to ftguzunti.py tlfong01 2013jun10 ...
# *** Webcam ***
ftwebcam.TestWebcam()
# *** Stop program message ***
ftprint.StopProgram()
# .END
No comments:
Post a Comment