ArduCAM_USB_Camera_Shield icon indicating copy to clipboard operation
ArduCAM_USB_Camera_Shield copied to clipboard

Regarding MT9V034

Open Moinelly opened this issue 7 years ago • 18 comments

Hey Lee, I have started to work on MT9V034 and so far it is going well in window's. I can control the camera in Trigger mode and auto-trigger mode,can change the exposure timing etc.. but the problem is everything is working good in windows but when i run the python script in Raspberry pi i can't see anything all i can

"device open success! transfer task create success! capture fail! device close success!"

but when i use AR0134 i am getting a display with 3 to 4 fps but i can't get anything in MT9V034

Moinelly avatar Dec 11 '17 07:12 Moinelly

Try to add this line to the example code: ArduCam_writeReg_8_8( useHandle, 0x46, 1, 0x05);

ArduCAM avatar Dec 12 '17 03:12 ArduCAM

Thank you! It worked ArducamSDK.Py_ArduCam_writeReg_8_8( handle, 0x46, 1, 0x05);,I used this

Moinelly avatar Dec 12 '17 07:12 Moinelly

I have used your MT9V034_demo.cpp code in raspberry_pi. It is compiling error free but when i run the Test file. i get error

./Test: error while loading shared libraries: libArduCamLib.so: cannot open shared object file: No such file or directory

I have tried - ldd Test,and in the response i got

libArduCamLib.so-not found

and i have tried to update the cache by "sudo ldconfig -v" nothing is solving problem,What could be the solution,can you help me in this how to locate/add shared library ASAP

Moinelly avatar Dec 24 '17 13:12 Moinelly

Please copy these .so files to your /lib and /usr/lib folder.

ArduCAM avatar Dec 24 '17 13:12 ArduCAM

It worked ./Test is working but the error is,

*** Error in ./Test: double free or corruption (fasttop): 0x00410ae8 Aborted

what is this error,I have not made any changes in the code and i copied all the .so files in /lib and /usr/lib folder

Moinelly avatar Dec 24 '17 14:12 Moinelly

run the demo with command "sudo MALLOC_CHECK_=0 ./Test"

ArduCAM avatar Dec 24 '17 14:12 ArduCAM

sudo MALLOC_CHECK_=0 ./Test worked perfectly,The problem now arises is after "ArduCam_open successful" nothing is displayed i.e the code is not going in while loop and stuck there. what is problem here?and can you please provide the solution. Thank you!

Moinelly avatar Dec 24 '17 14:12 Moinelly

image

I'm stuck here!can you please provide the solution because the same thing is happening when i use demo python code for MT9v034, once in a blue moon it's displays the image after that it get stuck in the middle. Please provide the solution to this problem. ASAP Thank you very much

Moinelly avatar Dec 24 '17 14:12 Moinelly

Make sure if the hardware is well connected in Windows before moving to RPI. It seems that your camera is not well connected.

ArduCAM avatar Dec 24 '17 14:12 ArduCAM

I have checked it in windows. It is working perfectly but when i shift it to RPI the problem is encountered. i didn't change the hardware or software. AR0134 is working in RPI but the problem is MT9V034. like i said once in a blue moon it works perfectly in RPI later when i test it. i encounter the same problem. What is the solution? Thank you!

Moinelly avatar Dec 24 '17 15:12 Moinelly

What is blue moon? It is 23:00 here, too late. I will check it tomorrow.

ArduCAM avatar Dec 24 '17 15:12 ArduCAM

It just a phrase,what i was trying to say is the device works randomly,and when i check it again it stuck. we will solve it tomorrow. Thank you for the help!

Moinelly avatar Dec 24 '17 15:12 Moinelly

Hey Lee, I have checked MT9V034 in Windows it is working perfectly but when i shift the hardware to Linux/RPI, I'm getting the same problem. The code is stuck and nothing is working.I have checked it in python code and cpp code same problem but i didn't get any problem when i tested AR0134. as far as my knowledge the code is going in While loop(python code) after that it get stuck and even i don't get any response from the thread. What could be the problem? Can you provide a solution ASAP. Thank you

Moinelly avatar Dec 25 '17 07:12 Moinelly

Please try the update example for MT9V034 www.arducam.com/downloads/app/ArduCAM_USB/RPI/MT9V034_RPI_SDK_Demo.tar.gz

ArduCAM avatar Dec 25 '17 12:12 ArduCAM

Thank you! It's working now,can you tell me what was the problem occurred here?

Moinelly avatar Dec 25 '17 12:12 Moinelly

i have made following changes in python code to make it work in trigger mode,the problem is the camera is going in trigger mode but not displaying anything. ` def video():

global flag,regArr,handle

data = {}

regNum = 0

res,handle = ArducamSDK.Py_ArduCam_autoopen(cfg)

ArducamSDK.Py_ArduCam_writeReg_8_8(handle, 0x46, 1, 0x05)

ArducamSDK.Py_ArduCam_writeSensorReg(handle, 0x03, 0x1E0)

ArducamSDK.Py_ArduCam_writeSensorReg(handle, 0x04, 0x2F0)

ArducamSDK.Py_ArduCam_writeSensorReg(handle, 0x07, 0x398)
if res == 0:

	openFlag = True

	print "device open success!"

	#while (regArr[regNum][0] != 0xFFFF):

		#ArducamSDK.Py_ArduCam_writeSensorReg(handle,regArr[regNum][0],regArr[regNum][1])

		#regNum = regNum + 1

	res = ArducamSDK.Py_ArduCam_beginCapture(handle)

	#print "Res value \n"

	#print  res

	#ArducamSDK.Py_ArduCam_writeSensorReg( handle, 0x46, 1)

	

	if res == 0:

		print "transfer task create success!"

		while flag :		

			#print "inside the while loop \n"

			res = ArducamSDK.Py_ArduCam_capture(handle)

			if len(data) >= Width * Height:

				if time1 - time0 >= 1:

					print "%s %d %s\n"%("fps:",count,"/s")

					count = 0

					time0 = time1

				show(data)

			

			if res != 0:

				print "capture fail!"

				break

			time.sleep(0.005)

			if flag == False:		

				break

	else:

		print "transfer task create fail!"

	res = ArducamSDK.Py_ArduCam_close(handle)

	if res == 0:

		openFlag = False

		print "device close success!"

	else:

		print "device close fail!"

else:

	print "device open fail!"

if name == "main":

video()

`

Moinelly avatar Dec 26 '17 08:12 Moinelly

@ArduCAM Hey , Have you updated your so file.because when i run the code i am getting an import module error for ArducamSDK.Py_ArduCam_available(handle) > 0 I have referred to your library which you shared one month back,in it the spell for available was availiable. Regards, vallabh

Moinelly avatar Feb 05 '18 06:02 Moinelly

can i trigger arducam with external pulse at 20hz rate? I need to sync the camera with imu

Razbotics avatar Dec 21 '18 14:12 Razbotics