CHDKPTP File Downloading - page 5 - General Help and Assistance on using CHDK stable releases - CHDK Forum

CHDKPTP File Downloading

  • 92 Replies
  • 35329 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP File Downloading
« Reply #40 on: 12 / January / 2018, 15:00:49 »
Advertisements
I should probably call an exorcist.
Uhm, no*. You just found a bug. In case you find more in the future, please report them - the best place to do that is the camera's porting thread.

I fixed LED behaviour on the a3400 - I happen to have one, but was not aware of the non-working set_led().
Please install revision 4975 or later, once they become available (in a few hours).
LED 0 = green LED, LED 1 = AF LED.

*edit:
Or maybe you should... set_led() should have been completely non-functional on the a3400...
« Last Edit: 12 / January / 2018, 15:24:19 by srsa_4c »

*

Offline reyalp

  • ******
  • 14125
Re: CHDKPTP File Downloading
« Reply #41 on: 12 / January / 2018, 16:02:29 »
Also I know I can use save_list to save camera id's, but is there a way to persistently map cameras to libusb id's?
If you want to get the same ids in multicam (these are multicam IDs, there is no "libusb id" that I know of), just use the list in connect, e.g. mc:connect({list='mylist.txt'})

If you look at the definition of mc:connect() this is documented (though not very clearly)

*edit:
Or maybe you should... set_led() should have been completely non-functional on the a3400...
Yeah, if the old set_led did something :o
Don't forget what the H stands for.

Re: CHDKPTP File Downloading
« Reply #42 on: 12 / January / 2018, 16:03:24 »
Quote
Or maybe you should... set_led() should have been completely non-functional on the a3400...
Cool I probably just broke the green led's with my ineptitude. I'm super glad thats a bug though and not something wrong with the cameras. I never even thought about the possibility of it being a bug I just assumed I was screwing it up somehow.

So here's a gui question; how would I go about creating a text field in chdkptp? I found this for the console
Code: [Select]
-- console input
inputtext = iup.text{
expand = "HORIZONTAL",
}

I'd like to expand on my shoot naming system, I'll link a picture I posted earlier so you know what I'm talking about.


Under "NAMING" I have the numbers 1-6. If I hit "6" for example it will extract the photos on the cameras to the folder "S6". I'd like to make it so I have a text field instead of numbers, where I could type "muskrat" and have the photos put into a folder called "muskrat". I haven't really played around with iup.text yet so it might be easier than I thought, but something tells me I'm gonna fail in some way or another so I figure I might as well ask now.

Re: CHDKPTP File Downloading
« Reply #43 on: 15 / January / 2018, 12:38:41 »
I updated to r4976 but set_led still isn't doing anything

edit: Nevermind I got it!
« Last Edit: 15 / January / 2018, 12:40:21 by jdstech »

*

Offline reyalp

  • ******
  • 14125
Re: CHDKPTP File Downloading
« Reply #44 on: 15 / January / 2018, 12:54:31 »
So here's a gui question; how would I go about creating a text field in chdkptp? I found this for the console
Code: [Select]
-- console input
inputtext = iup.text{
expand = "HORIZONTAL",
}
Unless I'm missing something, you should be able to just put an iup.text with your other controlls. You can use the .value field elsewhere (e.g. in a button handler) to access the value

IUP documentation is at https://webserver2.tecgraf.puc-rio.br/iup/

Don't forget what the H stands for.

Re: CHDKPTP File Downloading
« Reply #45 on: 15 / January / 2018, 16:32:56 »
Quote
Unless I'm missing something, you should be able to just put an iup.text with your other controlls. You can use the .value field elsewhere (e.g. in a button handler) to access the value
Awesome, got it working.

I'm still working on fixing these cameras that keep giving me I/O errors. I have three of the cameras in question connected to a usb hub (and only 3). I've been trying to update them to the latest version of chdk and if I cut connection to my keyboard and mouse while it's updating I get an imediate I/O error. I could however update the other cameras fairly successfully while disconnecting and reconecting my kb&m. So it appears that when the system tries to update it's usb connections with these specific cameras plugged in it gets hung up somewhere.

I don't know if this relation helps you in any way but I figured it might be significant and I really need to get these cameras working.

*

Offline reyalp

  • ******
  • 14125
Re: CHDKPTP File Downloading
« Reply #46 on: 15 / January / 2018, 17:12:41 »
I'm still working on fixing these cameras that keep giving me I/O errors. I have three of the cameras in question connected to a usb hub (and only 3). I've been trying to update them to the latest version of chdk and if I cut connection to my keyboard and mouse while it's updating I get an imediate I/O error.
This really sounds like something happening at a much lower level than anything chdkptp does. However, it's probably true that chdkptp doesn't handle error conditions robustly. I don't remember if the inherented ptpcam code tries to do anything in  response to STALL http://wiki.osdev.org/Universal_Serial_Bus#STALL

When I have some time I'll look into whether there's additional diagnostics I can put into chdkptp.

A keyboard / mouse might be a low speed / USB1 device. IIRC connecting low speed devices to hubs can affect how they interact with other devices.

Maybe single TT vs multi TT could be relevant https://en-us.knowledgebase.renesas.com/English_Content/SoC%2CASSP/Basic_Information/What_is_the_difference_between_Single-_TT_and_Multi-TT%3F
https://community.cypress.com/docs/DOC-10835

You might try PTP live view with just one camera to reproduce the error. That should produce a fairly continuous stream of data, without messing up your SD card when it fails in the middle.
Don't forget what the H stands for.

Re: CHDKPTP File Downloading
« Reply #47 on: 18 / January / 2018, 13:55:05 »
Awesome, everything is working fairly well ATM. I'm still getting some I/O errors but I found a work around. I'm hoping it wasn't this easy the whole time cuz if so I'd feeling REALLY stupid, but after getting I/O errors I can just refresh the camera list (via mc:connect) and keep going.

I still have a few things I'd like to add, and I'll keep refining my system, but chances are we won't be keeping this array for much longer. If any of you would be interested in buying some 3400's let me know. I have around 42 3400's that are working well, and another 6 or so that work fine on their own but cause trouble with multicam. I also have around 16 other cameras that are a mix between 3300's, 2500's, and 4000's. I'm not sure exactly what they're worth so if you're interested throw me an offer. I'm sure I could probably talk my boss into letting me send you guys a couple free ones too since you've been such a huge help.

I'll also attach my modified version of chdkptp in case you guys wanna play around with it. Again I'll keep working on it and trying to make it work better with the rest of chdkptp, probably on my own time. If you have anything you'd like me to prototype in the gui let me know, it's the least I can do to repay you for all your help. I wish I could help out around the forum but I feel a bit out of my league, maybe once I get more aquainted with the system I could be of more assistance.


Re: CHDKPTP File Downloading
« Reply #48 on: 23 / January / 2018, 12:43:41 »
Yay more I/O errors!

So I've sorted things out for the most part. I'm still getting occasional I/O errors like I did before but my current thinking is that it has something to do with electrical interference amidst the spiderweb of wires. I shot a bit of hot melt glue on the USB contact points (microusb to cameras, usb to usb extenders, etc.) to avoid wiggling and I'm not getting the same kind of random temperment I was getting before. Something I noticed about Alpha hub (the troublesome one) is that there are two usb to extender "joints" right next to eachother, and it's the only tower with that issue.

So now I'm getting a different problem involving I/O errors, and this seems like it might be a software issue. The events leading up to this issue goes like so:

I connect to all 62 cameras (the number of cameras I'm using varies a bit) and everything is going just fine. I can start and stop the cameraside script as much as I'd like with no trouble.

I hit prepare which just runs this code
Code: [Select]
self:cmdwait('rec',{printcmd=false})
self:cmdwait('call set_prop(props.FLASH_MODE, 2)',{printcmd=false})
self:cmdwait('preshoot',{printcmd=false})

printf("ready to shoot\n")
return

I'll occasionally get an I/O error here, at the moment I'm considering it an EM interference issue and I think my hot melt glue helped a bit. Normally however this works fine and I can take a shot.

I then go to the download stage, which starts fine but at some point it stops and gives me an I/O error. Then when I try to connect it connects to a few cameras before freezing briefly and giving me an I/O error again. This now happens every time I try to connect. I end up having to walk around switching off individual hubs until I find the one causing the errors, and after successfully connecting with the hub off I can switch it back on and connect to it fine.

It's probably worth noting that I don't actually turn off any of the cameras on the problematic hub, I just flick the power switch on the hub. I'll link to the USB hubs I'm using below, I really like them. They have two SPST switches, each one is responsible for 6 usb ports, and all they do is open and close the negative usb power line. This means I could make a wire that runs between all the hubs connected to a single switch and use that as my trigger.

Anyway this I/O error problem I'm getting happens consistanly in this order, occasionally one of the cameras on the connected hub will freeze and I have to manually disconnect and reconnect power to get it running again. There don't seem to be any particularly troublesome hubs/cameras. My guess would be that it's a chdk firmware problem.

Link to the USB hubs: https://www.amazon.com/gp/product/B01MSVRCKH/ref=ox_sc_sfl_title_3?ie=UTF8&psc=1&smid=A2FJ4BFHX4X7NN

« Last Edit: 23 / January / 2018, 13:01:00 by jdstech »

*

Offline reyalp

  • ******
  • 14125
Re: CHDKPTP File Downloading
« Reply #49 on: 23 / January / 2018, 13:13:34 »
Anyway this I/O error problem I'm getting happens consistanly in this order, occasionally one of the cameras on the connected hub will freeze and I have to manually disconnect and reconnect power to it to get it running again.
Do you mean the camera itself freezes (stays on but physical controls have no effect), or an actual crash (shuts down), or just an IO error like before?

I guess you mean IO error, since cycling the hubs resolves it?

Quote
There don't seem to be any particularly troublesome hubs/cameras from what I can tell. My guess would be that it's a chdk firmware problem.

The fact that power-cycling a hub corrects the problem argues against this IMO. It's quite possible that CHDK/chdkptp don't handle the errors as they should.

It wouldn't be surprising for downloading to show errors that aren't apparent in normal operation. If you had a random error rate of 1 per 100 MB transferred, it would be extremely rare in shooting, but should happen ~once on average downloading a large jpeg from all 60 cameras.

I still need to look at chdkptp error handling some more. I confirmed it doesn't use the stall clearing code in normal operation, but I need to spend some time with documentation to understand how it's supposed to used.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal