multicam, first steps, syntax wrong? - page 3 - General Help and Assistance on using CHDK stable releases - CHDK Forum

multicam, first steps, syntax wrong?

  • 34 Replies
  • 7714 Views
*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #20 on: 15 / April / 2022, 17:42:25 »
Advertisements
should i first run make after setup-ext-libs and before bin-snapshot?
Yes, as I said:
If so, you need to run setup-ext-libs first.


Quote
because i just tried  setup-ext-libs and then bin-snapshot but that wasn't it i guess :)
Code: [Select]
misc/bin-snapshot.bash
chdkptp-rUnversioned directory-Linux-x86_64.zip
Makefile:163: bottom.mk: No such file or directory
make: *** No rule to make target 'bottom.mk'.  Stop.
bin-snapshot.bash error: build failed

just tried 'make clean all', it gave the same bottom.mk error
but i can see it in the trunk folder.
I have never seen that before. I thought it might be related to using the zip, but I just tried that and it make worked fine.

bin-snapshot assumes it's running from an SVN checkout, which is why you get the "Unversioned directory" in the zip name, but surprisingly that doesn't seem to break anything either.

what distro are you using?

This really shouldn't be so hard. I've done dozens of times on clean installs of various distros.
Don't forget what the H stands for.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #21 on: 15 / April / 2022, 18:01:40 »
it appears no breeze for me, with no prior experience in this i expected a little resitance, but didn't see this coming.......i'm running 21.10 at this moment.
i did notice something that could have been a svn download when i ran bin-snapshot from the trunk folder.


due to some unfortunate problems i had to rebuild my chdkptp system twice and as soon as i've got this working and 22.04 is out i will reinstall again, hopefully with a proper zip to unpack :)
« Last Edit: 15 / April / 2022, 18:10:26 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #22 on: 15 / April / 2022, 19:03:23 »
it appears no breeze for me, with no prior experience in this i expected a little resitance, but didn't see this coming.......i'm running 21.10 at this moment.
Assuming you mean Ubuntu 21.10, I've used that without issue, starting from a clean install on a virtualbox VM.

From my notes, the chdkptp / development related packages I installed were

Code: [Select]
libusb-0.1 libusb-dev libreadline-dev subversion zip build-essential

plus the following for GUI (these may only be required if building IUP/CD)
Code: [Select]
g++ libfreetype6-dev libgtk-3-dev libx11-dev libxpm-dev libxmu-dev libxft-dev

I really don't understand why this has been so difficult. I realize this isn't helpful to you, I'm just baffled as to why something that should be straightforward has been such a problem. Are you running it on a dedicated machine, or using WSL?

Quote
i did notice something that could have been a svn download when i ran bin-snapshot from the trunk folder.
bin-snapshot does not download anything or do anything with svn other than trying to get the current revision number.

To use svn, you should install it with the package manger (On ubuntu, apt-get install subversion) and then use the svn checkout command I posted earlier.
Don't forget what the H stands for.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #23 on: 16 / April / 2022, 02:16:28 »
From my notes, the chdkptp / development related packages I installed were

Code: [Select]
libusb-0.1 libusb-dev libreadline-dev subversion zip build-essential

here there might be an answer...i can't recall me specifically installing libusb-dev, only libusb-0.1...nope, installing libusb-dev didn't change the outcome...bottom.mk no such file....

Quote
plus the following for GUI (these may only be required if building IUP/CD)
Code: [Select]
g++ libfreetype6-dev libgtk-3-dev libx11-dev libxpm-dev libxmu-dev libxft-dev
unless these all come from build-essential, like g++, i can't recall installing any of these.
Quote
I really don't understand why this has been so difficult. I realize this isn't helpful to you, I'm just baffled as to why something that should be straightforward has been such a problem. Are you running it on a dedicated machine, or using WSL?
dedicated machine, but not top notch: it's a planned obsolescence laptop with crippled hardware by design from hp.
Quote
To use svn, you should install it with the package manger (On ubuntu, apt-get install subversion) and then use the svn checkout command I posted earlier.

did the svn checkout a few posts back, but no change.
i'll run over all this later...been making notes as well, maybe i can shave a bit on the install/build instructions when i finished this.

last try from fresh trunk folder and fresh svn download(getting desperate and redundant, fresh trunk is 1167), installed libfreetype6-dev and that solved it. mind you not for the zip, only for the svn download.

great, now i can get back to trying loadfile.
my attempts to put loadfile in a sentence are not working out yet: i am trying to use the .0 file as source in loadfile, but that appears to go nowhere....is rlibs the missing link in this?
« Last Edit: 16 / April / 2022, 16:29:16 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #24 on: 16 / April / 2022, 18:15:49 »
here there might be an answer...i can't recall me specifically installing libusb-dev, only libusb-0.1...nope, installing libusb-dev didn't change the outcome...bottom.mk no such file....
IMO there is virtually zero chance the bottom.mk error is caused by packages. The only things I can think of are
1) Some environment variable in the shell you are running make it is conflicting with makefile variables
2) Something is actually changed / broken in your copy of the source tree
3) Some command on your path used by the makefile doesn't behave as expected, perhaps a different program with the same name

But this is all just wild guesses. It would be nice to know, but if I can't reproduce the problem it would be up to you to debug it.

Quote
dedicated machine, but not top notch: it's a planned obsolescence laptop with crippled hardware by design from hp.
Should not matter at all
Quote
last try from fresh trunk folder and fresh svn download(getting desperate and redundant, fresh trunk is 1167), installed libfreetype6-dev and that solved it. mind you not for the zip, only for the svn download.
IMO, there's zero chance that freetype was responsible for the bottom.mk error.

Quote
my attempts to put loadfile in a sentence are not working out yet: i am trying to use the .0 file as source in loadfile, but that appears to go nowhere....is rlibs the missing link in this?
You would need to describe specifically what commands you using and what you are trying to do.
Don't forget what the H stands for.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #25 on: 17 / April / 2022, 14:21:41 »

IMO there is virtually zero chance the bottom.mk error is caused by packages. The only things I can think of are

2) Something is actually changed / broken in your copy of the source tree
3) Some command on your path used by the makefile doesn't behave as expected, perhaps a different program with the same name
i don't have a program with the same name.
after that bottom.mk file had failed a few times, i checked the file and it appeared empty. i do not know for certain if this was already broken in the zip, but i rather doubt that. what the reason was the the file was empty i have no clue, but i detected it after
Code: [Select]
misc/setup-ext-libs.bash ran into trouble in finishing.
i then downloaded everything anew and started over and then after that lettertype it worked.
that's all i have noticed, i hope it helps.
Quote

You would need to describe specifically what commands you using and what you are trying to do.
i think that might be something for another thread in script writing...
i want mc to load the script on the camera and started with my own script :)
but entering that whole string of menu items looks a bit bothersome and if i change a setting i have to do the pc string as well.
so i downloaded the SUIx.0 file from the cam as suix.set and hoped to include that in the string, something like
Code: [Select]
!mc:cmd("call 'source home/xxxx/chdkptp/data/suix.set'; loadfile('A/CHDK/SCRIPTS/SUIx.lua')(nowait)") but it seems that i am cutting the corner by too much ;)
« Last Edit: 17 / April / 2022, 14:28:44 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #26 on: 17 / April / 2022, 17:44:10 »
so i downloaded the SUIx.0 file from the cam as suix.set and hoped to include that in the string, something like
Code: [Select]
!mc:cmd("call 'source home/xxxx/chdkptp/data/suix.set'; loadfile('A/CHDK/SCRIPTS/SUIx.lua')(nowait)") but it seems that i am cutting the corner by too much ;)
This seems like you're trying to mix up some unrelated things:
mc:cmd runs camera side commands defined by the chdk.rlibs:register call near the end of multicam.lua. Those commands are defined in the 'cmds' table in that code.

'call' is one of those commands, defined in
Code: [Select]
function cmds.call()
It runs arbitrary camera side lua code. Generally this means standard Lua functions and the functions described in https://chdk.fandom.com/wiki/CHDK_Scripting_Cross_Reference_Page

'source' is a chdkptp CLI command, which executes CLI commands in the named file on your PC. This runs in chdkptp, on your PC. The available commands are those listed by the 'help' command, mostly defined lua/cli.lua in chdkptp source. You cannot run this with mc:cmd

There is no camera side 'source' function, nor any built in script function to load values from script saved settings. There is a new CLI command in the version of chdkptp you built called 'camscript' which does allow this. I'll describe it more in a separate post

Code: [Select]
loadfile('A/CHDK/SCRIPTS/SUIx.lua')(nowait)
loadfile is a standard Lua function, which loads a file containing Lua code, and returns a function which is equivalent to executing the contents of the file. Since it returns a function, adding () at the end immediately executes the returned function. When executing camera side Lua (as with mc:cmd('call ...') or the = or . command in chdkptp), you can use it to load script files from the camera. However, what you intend with the 'nowait' is not clear to me. Since the contents of the file become the function, it doesn't have any named parameters. You can access parameters to the function created by loadfile using the Lua ... construct, but you would need to do this inside the script file.

I'd strongly encourage starting with small pieces, understanding how they work, and putting them together to build bigger parts. If something doesn't do what you expect, try  to break it down to simpler cases until you understand what it's doing.
Don't forget what the H stands for.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #27 on: 17 / April / 2022, 18:26:11 »
I'd strongly encourage starting with small pieces, understanding how they work, and putting them together to build bigger parts. If something doesn't do what you expect, try  to break it down to simpler cases until you understand what it's doing.

i thought i started small by creating a set clock to utc+1 script, and then adding a few lines to start of the cam side script. but apparantly that's not small enough for me :P
Code: [Select]
!mc:cmd("call loadfile('A/CHDK/SCRIPTS/SUIx.lua')(nowait)")
that showed me that the cam was activated, however it obviously crashed without a picture since it was missing the menu item settings.
so then i thought of getting the settings list from the cam and that worked.
by then i got lost  ???
and came to the conclusion that this is not (yet) possible, but i'm eager to learn about camscript.

the rest of your answer needs a bit more time, because it's is really hard to follow for me.
« Last Edit: 17 / April / 2022, 18:35:02 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #28 on: 17 / April / 2022, 19:32:42 »
camscript description is here: https://chdk.setepontos.com/index.php?topic=14523.0

If you wanted to make a script you could run from loadfile, you would use something like
Code: [Select]
camscript -cfg=A/CHDK/DATA/SUIx.0 A/CHDK/SCRIPTS/SUIx.lua -save=suix2.lua
and then upload suix2.lua

Note files starting with A/ are *read* from the camera, but saving the generated files to the camera is not currently supported.

However, as I said earlier, I wouldn't recommend trying to use loadfile to run a shooting script inside multicam.

The scripts won't be synchronized anyway (for example, they would take widely different amounts of time for half shoot to complete), so you can just connect to each camera in turn and start the script.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14126
Re: multicam, first steps, syntax wrong?
« Reply #29 on: 17 / April / 2022, 23:43:09 »
what i'm trying to make is a rig with 2 cams that shoot syncronised without end. i'm not that interested in getting it right up until the milisecond, but the closer i get, the better.
i was thinking of using multicam for that or use an usb 5v pulse.
multicam wasn't written to be an intervalometer. The main use case it was written for is rigs with large numbers of cameras in a studio type setting, generally the kind of thing in the threads linked from https://chdk.fandom.com/wiki/Multiple_Cameras_using_CHDK.

While multicam can shoots bursts with an interval, the script does not change exposure during the burst. The idea for bursts was mainly that you could do bracketing using CHDK native bracketing, or the subject could be rotated on a turntable or things like that.

Bursts of hundreds or or thousands of shots would likely have other problems.

Of course, it's all Lua code, so in principle you can add whatever you want.

Quote
however, i would like the cams to keep shooting even if the pc is not available with the risk of loosing syncronisation due to rtc differences between cameras.
this means something has to run cam side that keeps the interval going if there is no message from the pc within the set time.
This sounds complicated, and again, not really a scenario multicam was written to support. The multicam script will keep running if the PC goes way (like any other PTP script) but all actions are in response to messages sent by the PC.

If you run a script from within multicam using loadfile, the multicam script will not see any other commands from the PC until the loadfile script ends.

If you really need this kind of failover, trying to build it on multicam will probably be more complicated than designing something specifically for this purpose. If it were my project, I I'd probably start by looking for ways to make the PC part reliable enough not to need it.


Quote
seperate, but related:
i also have this one project that is running for over 4 years now with one stand alone cam. this cam needs occasional syncronisation with time and i do that by hand.
i wrote a simple line to only set the clock: press the button and all active cams will be set.
since mc already had utc and a fairly accurate timing loop it looked most obvious for me to use that.
For a single camera, there's no reason to use multicam. You can use cli command, or the functions it uses in camclockutil.lua.

Quote
i was thinking of connecting the pc every now and then to that cam to set the clock.
this can be done each time i exchange the sd card, but ideally i think it should be possible to do that at any given moment during the script run (reboot, between shots, maybe once a day)
should this entail stopping the cam side script, setting rtc, starting the cam side script?
chdkptp uses a CHDK Lua function to set time. So if another script that is not aware of chdkptp is running, you'd need to stop it.

In principle you could modify your script to check for a message like multcam.lua does, but it would be complicated: You can't just send message that says "set the time to X:Y:Z" because if the script is in the middle of shooting, it could be seconds before it checks for the message. So you'd need one message from the PC that says "let me know when you're ready to set the clock", then a response from the script that says "ready" and waits for a response that has the actual time to set.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal