Ubasic:1 Unk Smt Error? - LUA Scripting - CHDK Forum

Ubasic:1 Unk Smt Error?

  • 7 Replies
  • 5978 Views
Ubasic:1 Unk Smt Error?
« on: 15 / February / 2009, 14:39:51 »
Advertisements
I have bought a Canon A570is camera to use on my model plane to replace a Minolta X50.

I have managed to write a Lua script that will fire the shutter at 1 second intervals whilst the USB port has a 5v signal and stop when the power is removed. Also if the USB port is given a short 'blip' of power the camera will shut down. This script works:-

--[[
rem 20090210
@title AP Photo Script v1
--]]

repeat
 b = 0
 
 repeat
   a = get_usb_power(1)
 until a == 1

 
 repeat
   b = b + 1 
   shoot()
   sleep (1000)
   a = get_usb_power(1)
 until a == 0

 
 if b == 1 then shut_down()
 end
 
until is_key "set"


I have tried to make the timing and length of the short pulse to shutdown the camera variable however I cannot get this script to work. The camera gives a 'Ubasic:1 Unk Smt' error (the 'm' in 'Smt' may be something else as I cannot read it clearly)

--[[
rem 20090215
@title AP Photo Script v2
@param a Interval (1/10 sec)
@default a 10
@param b Shots to Shutdown
@default b 1
--]]

if a < 1 then a = 1 end

if b < 1 then b = 1 end

c = a * 100

d = b + 1

repeat
 e = 0
 
 repeat
   f = get_usb_power(1)
 until f == 1

 
 repeat
   e = e + 1
   shoot()
   sleep (c)
   f = get_usb_power(1)
 until f == 0

 
 if e < d then shut_down()
 end
 
until is_key "set"


an any of you Guru's please see what I am doing wrong? I have tried altering various things all afternoon and am getting nowhere!!

Thanks
Richard

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Ubasic:1 Unk Smt Error?
« Reply #1 on: 15 / February / 2009, 14:41:53 »
have you actually named this file *.lua? make sure it is not called *.bas or *.lua.txt or anything else that is not *.lua

Re: Ubasic:1 Unk Smt Error?
« Reply #2 on: 15 / February / 2009, 14:47:24 »
Thanks for the reply the filename is 'V2 ap sd remote.lua'

Richard

*

Offline Hacki

  • ****
  • 359
  • EOS 80D
Re: Ubasic:1 Unk Smt Error?
« Reply #3 on: 15 / February / 2009, 14:55:18 »
Sure you havent enabled that stupid windows XP feature which will hide known file name extensions, and your file's name is "V2 ap sd remote.lua.txt"? Also, replace the whitespaces with underlines.

Regards

Re: Ubasic:1 Unk Smt Error?
« Reply #4 on: 15 / February / 2009, 15:08:35 »
Hacki, Thanks for the suggestion. I am 100% sure that it is a .lua file. Replacing the spaces with'_' in the file name did not help.

Regards
Richard

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Ubasic:1 Unk Smt Error?
« Reply #5 on: 15 / February / 2009, 15:16:02 »
what happens if you just call it remote.lua?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Ubasic:1 Unk Smt Error?
« Reply #6 on: 15 / February / 2009, 15:18:10 »
Well chdk clearly doesn't think it's *.lua, because it's feeding your script to ubasic. That's an ubasic error which should never appear if the script was being fed to Lua.

Look at the file with CHDK file browser to see what CHDK thinks about the filename.

a570 is vxworks and can take long filenames, but I'd avoid spaces and other weird characters (anything other than a-z, A-Z, 0-9, _, - and that one dot) in filenames. And if you wish to keep portability with dryos cams, stick to 8.3 convention.

Re: Ubasic:1 Unk Smt Error?
« Reply #7 on: 15 / February / 2009, 15:27:43 »
PhyrePhox hit the nail on the head. I renamed the file 'remote.lua' and it works perfectly. I will try to keep to an 8.3 naming convention from now on.

Thanks to all of you who replied. I never would have solved it without you.

Regards
Richard

 

Related Topics


SimplePortal © 2008-2014, SimplePortal