A couple of Multicam doubts and general help - page 10 - General Help and Assistance on using CHDK stable releases - CHDK Forum  

A couple of Multicam doubts and general help

  • 159 Replies
  • 70984 Views
*

Offline reyalp

  • ******
  • 14080
Re: A couple of Multicam doubts and general help
« Reply #90 on: 05 / February / 2020, 17:15:34 »
Advertisements
But every time I try to download files, there's one camera which shuts down/fails, i get the attached message (capture4.jpg) and after a few seconds the command window shuts down. I sometimes get an error poiting to the offending camera (capture1.jpg).
The chdkptp error really doesn't tell you anything. It just means USB communication failed. The most common case is probably the camera crashing, but problems in the USB system are also possible, especially in a multicam rig.

So you need to identify the failed camera, and determine what state it's in: crashed / shut down, frozen, or running normally. After the issue happens, you should be be able to physically identify a crashed camera since it will be shut down and the others will not.

You should also try to determine whether only certain cameras have the problem or if it happens randomly to different cameras, or only to certain models if you are using a mix of different models.

If a camera crashes, you should get a ROMLOG (see https://chdk.fandom.com/wiki/Debugging#Camera_crash_logs_.28romlog.29) and post it here.

If the problem affects only certain cameras, this could be due to different settings on those cameras, or problems with things like the power supply or USB hardware.

Quote
I've disabled   mc:connect({list='cams.txt'}) because i'm constanly unplugging cameras from the array trying to find which one is crashing/failing. And using that line caused errors if one or more listed cameras were not connected.
I believe there will just be a warning, and the missing camera won't be added to the list. If this isn't correct, what kind of error do you see?

Quote
Additionally, is there a way to have init_sync produce less verbose? It creates hundreds of lines, too many to scroll up and pinpoint which camera might be the offending one...
There isn't currently a way to disable those messages, but if a errors happen in download, I'm not sure why you are trying to spot the problem camera in init_sync.

You could use mc:check_connections immediately after download to identify the crashed cams.

Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #91 on: 06 / February / 2020, 06:10:59 »
After lots of testing, the crashing camera was identified. I produced a romlog (see attached) and it says Harware Defect so I'll probably have to discard it. It's odd because out from the rig, individually it seems to work fine. I wonder what the romlog says... (maybe power related?) In any case, I'm starting to realize that having different models mixed up is not the best way to go. I'm going to try to strip down the system to only A2xxx, SX150 and G10, which are the cameras that have proved to work reliably.
Every camera has it's own quirks, and one example are two old SD1300 I had lying around and included in the rig. They work, but for some reason (or quirk) their exposures are way off from the rest, and produce an error when shuting down the system (couldn't catch it, it happens a split second before the system shuts down). These are minor things, but if I'm looking for some degree of reliability, I'm going to have to discard them. There's a few other little things I may try to resolve in the future, but for now, I'm happy with the progress.
Hope the romlog is useful, thanks!


EDIT: About the error with mc:connect({list='cams.txt'}) I've attached a screengrab just before it closes. If I use mc:connect() , everything works fine. Can´t attach "cams.txt", here's the content:

Code: [Select]
{
 ["FF81F24C80E64C60B180914B936E8335"]={
  ["id"]=12
 },
 ["836BB0F4C82942328CE460978F650B7A"]={
  ["id"]=22
 },
 ["59F76D99E74D4E56A432C01AA1F25F70"]={
  ["id"]=08
 },
 ["8D6851BE4706416B83CB24D5C51E008C"]={
  ["id"]=04 },
 ["CFFBD611EBFA4B3AB7E7E96DDAACD3D7"]={
  ["id"]=05
 },
 ["535772AB22C94DC390105204ABE1CEB5"]={
  ["id"]=16 },
 ["7C5E599D846B453B9C3D2DC6FE50CA60"]={
  ["id"]=07
 },
 ["510EC32D808848FDAFB75076CD3321A7"]={
  ["id"]=17
 },
 ["4A7D94B66EA6466E8457913F3278263C"]={
  ["id"]=1
8 },
 ["5F000B5E65AA4054AA7379D9D15AEE9F"]={
  ["id"]=02 },
 ["CF100970CC43440C8B7A72FBBC70FE72"]={
  ["id"]=06
 },
 ["913E2905D0C345908575A42E463FF077"]={
  ["id"]=15
 },
 ["70C41C4110834DEAA1A54BCFE0F6BE70"]={
  ["id"]=13 },
 ["AA0D228C8F5D418B967549835F00EAB5"]={
  ["id"]=24
 },
 ["B4E1ACD96C454ECB84AC0685EF70D81A"]={
  ["id"]=01 },
 ["9D224B712F7D4F12B42EAEFA9FBE8388"]={
  ["id"]=21
 },
 ["5B844D15130B42328BD2DF240F41561A"]={
  ["id"]=20 },
 ["3B8F8341FB524051BC1666ABBA19B580"]={
  ["id"]=14
 },
 ["2C5B486D306C4596B4BAF7D7B6BD35B9"]={
  ["id"]=03
 },
 ["A0B8A1BD345B455A95B9C1F8AABCEFED"]={
  ["id"]=10
 },
 ["C483BAA2681E47A78D5A0B5FFFE5A8B2"]={
  ["id"]=11 }
}
« Last Edit: 06 / February / 2020, 06:53:49 by ikercito »

Re: A couple of Multicam doubts and general help
« Reply #92 on: 06 / February / 2020, 07:09:02 »
The shutdown error I mentioned before points to cameras 9, 14, 21 and 22. I traced them and they're exactly the "different ones" SD1300 and IXUS 145 and 160.. So once again, even if they work, i'll replace those with A2xxx.

*

Offline reyalp

  • ******
  • 14080
Re: A couple of Multicam doubts and general help
« Reply #93 on: 06 / February / 2020, 13:00:33 »
After lots of testing, the crashing camera was identified. I produced a romlog (see attached) and it says Harware Defect so I'll probably have to discard it.
Hardware defect doesn't always mean there's a hardware failure. Sometimes CHDK problems make the camera think there's been a hardware error.

However, yours is E18 (lens error) which is a common, real hardware failure.

Quote
It's odd because out from the rig, individually it seems to work fine. I wonder what the romlog says... (maybe power related?)
The romlog doesn't obviously tell, but if it only happens in the rig, power problems do seem like a reasonable guess. Or perhaps something about how it's mechanically mounted.

What model and firmware version is the failing camera?
Quote
EDIT: About the error with mc:connect({list='cams.txt'}) I've attached a screengrab just before it closes. If I use mc:connect() , everything works fine. Can´t attach "cams.txt", here's the content:
It looks like there might be a syntax error in your list, unless it was a mistake pasting in the forum:
Code: [Select]
["4A7D94B66EA6466E8457913F3278263C"]={
  ["id"]=1
8 },
If that's supposed to be 18, it shouldn't have a newline.

I should make the load_list report errors in cases like this. edit: updated to show an error in r926
« Last Edit: 07 / February / 2020, 00:11:17 by reyalp »
Don't forget what the H stands for.


Re: A couple of Multicam doubts and general help
« Reply #94 on: 07 / February / 2020, 13:35:27 »

What model and firmware version is the failing camera?
Its an IXUS 145 firmware version 100c. I've been testing further and it's a power problem, it all works perfectly until I try to download the images and the cameras go into PLAY mode, lens retracts and that's when I get the error. I've tested it with it's own battery and works fine. So it has to be power related.
Regarding cams.txt, you were right. That line break didn't show on windows notepad , but notepad++ did. Solved.
The system is starting to work :D

Re: A couple of Multicam doubts and general help
« Reply #95 on: 11 / February / 2020, 18:10:10 »
Hi again, testing goes on. I replaced a couple of faulting cameras. I have a couple of questions...
1) Not directly CHDK related, but is there some way to rename USB hubs in Device Manager so they don't show up the same "Generic USB Hub" name? It'd be handy to rename them with different labels in case one of the cameras goes rogue and shows "USB device not recognized", it would be handy for debugging.
2) I've replaced the faulty IXUS 160 and 145 with A2400s, and suddenly when using option 2 for zooming (see #88 for full code) everything fails... It used to work perfectly yesterday, before I replaced those. Nothing in the code has changed. And now I get "failed timeout" errors in 15 cameras that used to work perfectly before. Any ideas about what might be happening?

Code: [Select]
elseif option == '2' then        ---------SET ZOOM
  local zoom=cli.readline('Zoom>')
  mc:cmdwait('call set_zoom('..zoom..')')
3) I've finally implemented mc:check_connections in the menu as option "0". Is this the correct way to go? I've attached the error message I got after checking connections. It's been a last minute quick test and I didn't look if they reconnected.

Code: [Select]
mc=require('multicam')
mc:cmdwait('post_levent_to_ui"UnpressPowerButton"')
mc:connect({list='cams.txt'})
mc:start()
mc:cmdwait('id')
   
repeat
 print('0)CHECK 1)SYNC 2)ZOOM 3)SHOOT AF 4)MANUAL 5)AUTO')
 print('6)DOWNLOAD 7)SHUTDOWN 8)REBOOT')


 local option = cli.readline('mc>')
 
  if option == '0' then            --------CHECK
   mc:check_connections(cam_powercycle_cmd)
   mc:connect({list='cams.txt'})
   mc:start()
   mc:cmdwait('id')
   
 elseif option == '1' then            --------START&SYNC
  mc:cmdwait('rec')
  mc:init_sync()
4) Would something like this work if I needed to send manual commands to the cameras inside the? Or I should be looking for an exit/break to go back to the command line and then relaunch the script? I'm out of my water with this... :(

Code: [Select]
elseif option == '9' then        ---------COMMAND
  local command=cli.readline('>>>')
  mc:cmdwait('call ('..command..')')


In any case, question number TWO is the most important one. The rest are completely optional. Thanks!
« Last Edit: 11 / February / 2020, 18:35:05 by ikercito »

*

Offline reyalp

  • ******
  • 14080
Re: A couple of Multicam doubts and general help
« Reply #96 on: 11 / February / 2020, 21:18:44 »
Hi again, testing goes on. I replaced a couple of faulting cameras. I have a couple of questions...
1) Not directly CHDK related, but is there some way to rename USB hubs in Device Manager so they don't show up the same "Generic USB Hub" name? It'd be handy to rename them with different labels in case one of the cameras goes rogue and shows "USB device not recognized", it would be handy for debugging.
I don't think so. You may find USBView helpful https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview

Quote
2) I've replaced the faulty IXUS 160 and 145 with A2400s, and suddenly when using option 2 for zooming (see #88 for full code) everything fails... It used to work perfectly yesterday, before I replaced those. Nothing in the code has changed. And now I get "failed timeout" errors in 15 cameras that used to work perfectly before. Any ideas about what might be happening?
Not idea. Timeout without any other errors would normally suggest a software problem. USB connection problems, cameras completely freezing etc should generally cause a connection related error.

Some things to check:
* The default timeout for cmdwait is 10 seconds. I don't think zoom should take this long, if you want to try a longer timeout you could do something like  mc:cmdwait('call set_zoom('..zoom..')',{timeout=20000}) for 20 seconds.
* After the timeout, are you still able to communicate with the cameras? For example, if you send an mc:cmdwait('id') does it work and toggle the IDs on all cameras?
* Try disconnecting the recently added cameras  and see if it still works. If it does, you can try adding one at a time.
* Do any of the cameras move their lenses when you send the zoom command? Or does it timeout without doing anything?
* Electrical issues when trying to move all the zooms at once wouldn't be a surprise, but I'd expect different errors. USB problems might conceivably slow things down enough to trigger a timeout without actually failing, I guess.
Quote
3) I've finally implemented mc:check_connections in the menu as option "0". Is this the correct way to go? I've attached the error message I got after checking connections. It's been a last minute quick test and I didn't look if they reconnected.
The cam_powercycle_cmd is incorrect. mc:check_connections should be passed options you want to use for mc:connect, probably {list='cams.txt'}
In your case, check_connections reports that cameras 18 and 25 need to be restarted. You need to do this manually before continuing.
The errors after reconnect refer to camera 16 (and one that's cut off) but if you didn't pass the list in options, the numbers might be changed.

cam_powercycle_cmd is made for cases where the computer running chdkptp also has hardware control of the camera power supplies. The assumption is you have some external program which manipulates a GPIO or something like that.  It's a field in mc, not an argument to check_connections, so you'd set it once with something like:
Code: [Select]
mc.cam_powercycle_cmd = "/path/to/some_command"
The command would need to be custom code that accepts a camera ID number and controls the hardware.

Quote
4) Would something like this work if I needed to send manual commands to the cameras inside the? Or I should be looking for an exit/break to go back to the command line and then relaunch the script? I'm out of my water with this... :(

Code: [Select]
elseif option == '9' then        ---------COMMAND
  local command=cli.readline('>>>')
  mc:cmdwait('call ('..command..')')
That seems like it should work. Like always, mc:cmdwait will send the code to all selected cameras, so if you want to do different things on some cameras you'd have to use mc:sel first. If you want to execute local code, like you normally do with !, you'd need a different approach. You could either quit your script, or use something like your example above but instead of mc:cmdwait use
Code: [Select]
cli:print_status(cli:execute('exec '..command))
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #97 on: 12 / February / 2020, 07:36:34 »
Ok, I'll be testing those options later. I assumed powercycle was an option inside check_connections, my bad. So to clarify the workflow, once some cameras fail (after zooming for example) I'd need to mc:sel({1,3,5}) those problem cameras (1,3,5) and then mc:cmdwait('play') and mc:cmd('call sleep(2000) reboot()') (assuming they're still connected and have not crashed), and once they reboot (it'd be nice to have a beep to know they're back up) I send mc:check_connections. Or I got everything wrong? I could try to do all this from the 9 option I showed before...?
I'm not sure I got the grasp of how check_connections works. If I should reboot cameras manually (meaning physically turning them on and off by hand), I'm afraid that´ll be impossible, because the way the rig is built. I can only turn on/off the whole group of cameras at once.
Regarding that, I made some 3D printed clamps for various cameras models to have the ON button continually pressed. If waterwingz is interested (didn't get any feedback from the battery dummy 3d prints :( ) I could upload them to thingieverse too. Check the attached image.
EDIT:
Code: [Select]
cli:print_status(cli:execute('exec '..command))
That should be '..command)) or '..command..'))  ??
« Last Edit: 12 / February / 2020, 07:40:12 by ikercito »


*

Offline reyalp

  • ******
  • 14080
Re: A couple of Multicam doubts and general help
« Reply #98 on: 12 / February / 2020, 13:20:53 »
So to clarify the workflow, once some cameras fail (after zooming for example) I'd need to mc:sel({1,3,5}) those problem cameras (1,3,5) and then mc:cmdwait('play') and mc:cmd('call sleep(2000) reboot()') (assuming they're still connected and have not crashed), and once they reboot (it'd be nice to have a beep to know they're back up) I send mc:check_connections. Or I got everything wrong? I could try to do all this from the 9 option I showed before...?
I'm not sure I got the grasp of how check_connections works. If I should reboot cameras manually (meaning physically turning them on and off by hand), I'm afraid that´ll be impossible, because the way the rig is built. I can only turn on/off the whole group of cameras at once.
In the vast majority of cases, I'd expect you need to physically restart the cameras if it's failed in check_connections(). If you can execute a script to reboot, you probably don't need to reboot.
So in your case, you can use it to check if any are failed, but you'd have to reboot the whole group or rig.

Quote
Regarding that, I made some 3D printed clamps for various cameras models to have the ON button continually pressed. If waterwingz is interested (didn't get any feedback from the battery dummy 3d prints :( ) I could upload them to thingieverse too. Check the attached image.
If it's not much trouble, I don't see any reason not to post it. I expect others could find it useful in the future.
Quote
EDIT:
Code: [Select]
cli:print_status(cli:execute('exec '..command))
That should be '..command)) or '..command..'))  ??
The former. ".." concatenates a string. cli:execute expects a string like you'd type in the normal chdkptp command prompt. You want to joint "exec " with whatever you typed. So you could type mc:cmdwait('whatever') and get
Code: [Select]
exec mc:cmdwait('whatever')
(exec is the same as !)
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #99 on: 14 / February / 2020, 07:18:12 »
I've been quite busy the last couple of days and couldn't spend enough time working in the project. The cause for zooming problems is still unknown (though I suspect it's power related)
There's another issue that's been bugging me. I usually set the exposure values manually to have consistency between pics. I expect some discrepancies between different camera models, but there's one that is responding way off from the rest, it's an A3400. While the exposure on the rest is quite similar, this one is way darker. And even if the EXIF data says it's shot at f4 1/15 and ISO 100, given the amount of noise, I suspect it's shot at much higher ISO. Seems like it's not responding to the code... Is there any other way to set the parameters and see if it responds better?
This is the code regarding that area:

Code: [Select]
elseif option == '4' then        ---------SHOOT w/values
  local dist=cli.readline('Focus Dist>')
  local fnum=cli.readline('F number>')
  local shutter=cli.readline('Shutter speed>')
  local ISO=cli.readline('ISO>')
  mc:cmdwait('call set_prop(props.WB_MODE,1)')
  mc:cmdwait('preshoot')
  mc:cmdwait('call click"left" sleep(100) release"shoot_half"')
  mc:shoot({tv=exp.shutter_to_tv96(tonumber(shutter)), svm=exp.iso_to_sv96(tonumber(ISO)),av=exp.f_to_av96(tonumber(fnum)),sd=dist,nd=2})
I'm attaching a screenshot of the folder. It's camera 12, and it's not just -2 darker, it's much noisier too. Maybe it's (another) faulty camera? :(

 

Related Topics