Announcement

Collapse
No announcement yet.

Script ideas for A12 cams.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script ideas for A12 cams.

    SETUP script.

    Some of Ambarella A12 based action cams have similar problems with saving the settings after powering off or battery removal.

    So, here is an idea how to override this. An autorun script emulates buttons presses navigating and changing the settings right after the cam is powered up and then goes back to shooting mode.

    In order to do this we can use 't app key <key>' command, here is the list of available virtual keys to "press" with it and their functions:
    • up - one step up in main settings or page up in options
    • down - one step down in main settings or page down in options
    • left - one step up in options
    • right - one step down in options
    • set - ok/confirm
    • shutter - take photo in still mode, go back from settings
    • record - start/stop video recording
    • mode - switch between recording and playback modes
    • menu - go to settings from any mode, "press" again to go back to shooting mode
    • power - turn the camera off

    You can write down the sequence of buttons pressed in order to navigate through settings and turn them into script commands. You might want to add 'sleep 3' command in the beginning of your script to have a 3-sec delay for the cam to be ready.

    Here is a basic sample of such script: A12-SETUP-script.zip

    I use it for setting 1080p100 recording mode and for turning loop recording off which is set to 3 Min by default every time I turn my camera on. The script also sets 'Sports' scene mode. Doing it manually involves pressing several buttons 59 times. My SETUP script needs only ~4 seconds to complete running in auto mode.

    Note: Your camera settings menu structure might be different from mine. So this script is not aimed to work with any A12 action cam, its putpose is to show available scripting capabilities.
    Attached Files
    Last edited by nutsey; 01-20-2017, 03:08 PM.
    Donate here if you want to support my efforts and this site. Other options for gratefulness are also available on request.

    Email me if you have any offers, requests or ideas.

  • #2
    Busybox is back. Now we can run Linux commands from autoexec.ash scripts on A12 and A9 cams. Thanx Pablo Guerrero (the post is here).

    For example, we can press some buttons in addition to the method listed above.

    This command switches between video and photo modes:
    t ipc rpc clnt exec2 '/usr/bin/SendToRTOS record'

    This one is for shutter button:
    t ipc rpc clnt exec2 '/usr/bin/SendToRTOS photo'

    And this one will turn off your camera:
    t ipc rpc clnt exec2 '/usr/bin/SendToRTOS ok_btn'

    Or you can create a file on your memory card by using this command:
    t ipc rpc clnt exec2 'touch /tmp/SD0/GoPrawnWasHere'

    Put this string into your script to get CPU details:
    t ipc rpc clnt exec2 'cat /proc/cpuinfo' > c:\cpuinfo.txt

    PS: You can use 'exec1' instead of 'exec2'. It returns results after running which is pretty useless at the moment.
    Last edited by nutsey; 04-11-2017, 12:54 PM.
    Donate here if you want to support my efforts and this site. Other options for gratefulness are also available on request.

    Email me if you have any offers, requests or ideas.

    Comment


    • #3
      Script commands for setting current shooting mode. Can be useful when you don't know which mode is set by default:

      t app test chg_mode 0
      sets video mode.

      t app test chg_mode 1
      sets photo mode.

      t dechi switch 0/1
      Also changes shooting mode.
      Last edited by nutsey; 08-21-2017, 12:02 PM.
      Donate here if you want to support my efforts and this site. Other options for gratefulness are also available on request.

      Email me if you have any offers, requests or ideas.

      Comment


      • #4
        does this script syntax work on thieye t5? i tried putting the autoxecec.ash file at the root and it responded by creating a "pref" folder but no action was taken other than creating this "pref" folder, must we create a folder with a specific name ? thanks. ( i want to use it to restore ev-2 when the camera boots (at the moment there is a bug : (022817 firmaware) ev-2 is restored in the visual menu but is not set internally, i must set it to a different ev value than set it back to ev-2 if i want it to be set internally for shooting) .

        UPDATE : it works on t5 you just need to make sure your text editor does not put a 0d 0a at the end of each line but just a 0a
        Last edited by amanieux; 04-29-2017, 10:47 PM.

        Comment


        • nutsey
          nutsey commented
          Editing a comment
          Didn't get it. Do you want to set the EV correction to -2? Does your camera have this option in the settings menu?

        • amanieux
          amanieux commented
          Editing a comment
          yes the thieye t5 has the option to change ev (and ev-2 is much nicer as there is less overblown sky and white objects have more contrast)) but when you shut the camera down it saves the ev state in the menu to -2 (visually in the menu ) but always applies a ev=0 default value internally so each time i power up the camera i have to go in the menu and change the ev value back to -2 again

          UPDATE : it works you just need to make sure your text editor does not put a 0d 0a at the end of each line but just a 0a
          Last edited by amanieux; 04-29-2017, 09:57 PM.

      • #5
        these scrip commands works you just need to make sure your text editor does not put a 0d 0a at the end of each line but just a 0a

        here is a script that restores ev -2 at boot (IMAGE QUALITY MUCH BETTER IN EV -2 : contrast much closer to the yi 4k):

        1/set camera to ev to -2
        2/ shut the camera down
        3/ put this autoexec.ash text file at the root of the sd card (make sure there is just LF and not CR + LF at the end of each line of the text file - so choose your text editor wisely or use a hex editor to remove the 0x0d before the 0x0a at the end of each line of text in the file).

        #not sure if this sleep 1 second is useful but i still do it to let the camera finish to boot (was 3 second in the original script)
        sleep 1
        t app key menu
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key up
        t app key set
        #we are now in the ev settings
        t app key right
        #set ev to -1.7 (from previous state -2 because otherwise it does nothing as the software thinks he is already in -2 ) (i picked 1.7 but it can be any value <> -2)
        t app key set
        t app key set
        t app key left
        #set ev to -2 (from previous state -1.7)
        t app key set
        t app key menu
        Last edited by amanieux; 04-29-2017, 10:45 PM.

        Comment


        • AussieKev
          AussieKev commented
          Editing a comment
          This is good. My t5e does not have an UP button. What I need is Screensaver set to 1 minute on power up. So use "t app key" to screensaver should work. .
          Cam crashed, required battery removal and now is locked to boot FHD60, EIS- On, Video - Fine and rest default which was a bit of luck at least.

      • #6
        is there a script command to increase the video bitrate ?

        is there a script command to lower the level of noise reduction (image out of camera looks like a pastel as it wants to remove as much noise as possible but it erases all details, i'd rather have a tiny bit more noise and some more details).

        do you have a list of all commands available ?

        thanks for your great work.
        Last edited by amanieux; 04-29-2017, 10:43 PM.

        Comment


        • nutsey
          nutsey commented
          Editing a comment
          You can dump memory with this command (you might want to increase the dump size from 16Mb):
          Code:
          savebin c:\dump.bin 0xA0000000 l 16777216
          Then you have to find the offsets for bitrate values and change them with writeb/writel/writew commands.

          This script lists all commands (not all actually, but enough for us): https://www.goprawn.com/forum/main-f...t-for-a12-cams

      • #7
        This utility "t" does not appear to work through telnet for me on my Thieye T5e camera.
        Code:
        ~ # t app key mode
        -sh: t: not found
        It does though apparently work when in an autoexec.ash script in the root of the SD card.


        From within a telnet session to the camera :
        Code:
        ~ # /usr/bin/SendToRTOS record
        does change the camera mode (Video/Photo)

        and
        Code:
        ~ # /usr/bin/SendToRTOS photo
        acts like a shutter (Photo or Start/Stop the recording)

        Code:
        ~ # /usr/bin/SendToRTOS ok_btn
        does not turn off the camera

        Maybe I am missing something.
        My objective it to remotely control my camera through wifi which will be fixed somewhere out of reach.
        1. I will provide Power through microUSB: It will autostart
        2. Connect through wifi
        3. Change settings if needed and start recording
        4. Stop recording
        5. Download the files through wifi
        6. Turn off the camera remotely
        7. I will then remove power on microUSB

        Any help would be apreciated.

        I have stock firmware I believe it is TI/UN5-170112-V5.0 ,
        I have attached a generated info file of my camera
        Generated by ambainfo.sh [by petesimon] from within a telnet session ThieyeT5e_info.txt
        Generated by autoexec.ash [by Nutsey] (getinfo_script) on the root SD card ThieyeT5e_log.txt

        Thank you
        Attached Files
        Last edited by paucoma; 06-23-2017, 01:36 PM. Reason: New Generated file

        Comment


        • petesimon
          petesimon commented
          Editing a comment
          Hello. Thanks for using my linux ambainfo.sh script. But you should also use the 'getinfo' script from nutsey.
          https://www.goprawn.com/forum/main-f...-cams#post1536

          I have an eken h8 plus (A12) and I will think of some ideas to help you.

        • paucoma
          paucoma commented
          Editing a comment
          Hi petesimon,
          First: The thanks go to you for making the script , So Thank you
          Second, I had a look at the script and tried the commands on the telnet session I had open and since it didn't work I decided to use your script instead.
          I now, followed the instructions in the readme through the SD card and it actually has given output, and it seems that actually the command works. I will update my post.
          Third, Thanks Nutsey for the script ,

          I'm going to start a new thread as after investigating a bit I see, what I would actually like to be able to do has a bigger scope than just a simple script. Something along the lines of https://github.com/KonradIT/gopro-control , an HTTP API.
          Last edited by paucoma; 06-23-2017, 02:55 PM.

      • #8
        t dechi wifi 0
        turns wifi on.
        Last edited by nutsey; 09-10-2017, 03:09 PM.
        Donate here if you want to support my efforts and this site. Other options for gratefulness are also available on request.

        Email me if you have any offers, requests or ideas.

        Comment


        • #9
          I found the bitrate table in the latest firmware for T5e, I can edit it in the firmware and upload camera and it works, but using writew to do it just freezes the camera (i found the location in the dump.bin file), is there something I need to do before calling writew?

          I think I managed to find the current ISO location as well (seems to be 2 locations, at least for the unique value/key, values around it might need to be altered).
          Last edited by Athiril; 11-21-2017, 05:48 PM.

          Comment


          • nutsey
            nutsey commented
            Editing a comment
            There should be two types of 'ISO' values: analog sensor gain and digital gain.

          • Athiril
            Athiril commented
            Editing a comment
            Both areas were the same value when an ISO was set. Anyway, the major roadblock is that writew appears to not work.

            When I use writew address value the timer on the bottom of the screen freezes, the video feed to the LCD still works, the buttons still make sound when you press them but they don't do anything.

            Changing bitrate table in firmware was okay but using writew to do it did the above, for example the default value for sfine in 4K is 7042, I'm sure if I savebin then write 7042 to memory it'll still do that, even if it's the same value that's currently set.

          • nutsey
            nutsey commented
            Editing a comment
            Do you use the right byte order?
            writew offset 0x428C

          • Athiril
            Athiril commented
            Editing a comment
            I'm at work atm., I'll try again tonight

        • #10
          Cant believe I made dumb mistakes... anyway the bitrate table starts in 0x005591AE for the bitrates themselves and downwards in your savebin file for the TI/UN7-170908-V5.0 version of the official firmware for the T5E Mic port version, if you just do a savebin and search for C:\EVENT you'll find it below that.

          So writew 0xA05591AE 0x428C will set the S Fine setting to 4K 70mbps etc 0x42C8 100mbps iirc etc.

          I was forgetting the A offset, since we were dumping from 0xA etc
          Last edited by Athiril; 11-22-2017, 05:03 PM.

          Comment


          • #11
            100mbps tested on a new Sandisk microSDXC Extreme Pro UHS-I U3 V30 A1 card, stable, LCD screen was hot by the end of it. 10min 15sec before I manually stopped the recording.


            firmware version: TI/UN7-170908-V5.0
            sleep 3
            writew 0xA05591AE 0x42C8
            Last edited by Athiril; 11-27-2017, 02:47 PM.

            Comment


            • #12
              autoexec file for T5e Mic Port Version
              Firmware Version: TI/UN7-170908-V5.0

              S Fine - 100mbps
              Fine - 80mbps
              Normal - 60mbps

              First 26 settings in the bitrate table changed with those settings
              https://drive.google.com/open?id=1MGui14VtsdqO4YuH1XFM_NIBW-dziI9o
              Attached Files
              Last edited by Athiril; 12-10-2017, 02:20 AM.

              Comment


              • #13
                I'm working with the Firefly 8S (V67)
                Confirmed the Raw capture works with this camera. 17 MP image file!
                Confirmed the auto record script works

                My goal here is to enable WiFi automatically when the camera turns on.

                I'm looking at 4 approaches:

                1) I asked HawkEye if they could add a persistent setting in the menus, but they said they couldn't do it. I saw another request for this on facebook as well.

                2) I tried the 'to the point' command from Nutsey a few days ago, first adding a 7 sec delay.
                sleep 7
                t dechi wifi 0


                Didn't seem to do anything. Neither did setting the value to 1.

                It sure would be nice if this worked! Thoughts?

                3) The WiFi can be enabled by pressing and holding one of the buttons for a second or so.
                I'm not sure which button it maps to in the list however.
                • up - one step up in main settings or page up in options
                • down - one step down in main settings or page down in options
                • left - one step up in options
                • right - one step down in options
                • set - ok/confirm
                • shutter - take photo in still mode, go back from settings
                • record - start/stop video recording
                • mode - switch between recording and playback modes
                • menu - go to settings from any mode, "press" again to go back to shooting mode
                • power - turn the camera off
                The bigger issue is that it needs to be held active, not just pressed/released quickly, which is what I imagine the t app <key> will do.
                Is it possible to set the dwell time for the key?

                4) The last ditch approach is to bang through the menus to turn WiFi on. Again, not knowing exactly which button maps to which <key>, I'm working a bit blind.
                When I use a script to step through some keys, I don't see anything on the screen that would indicate it's working or not.
                Any suggestion on how to test the button/key mapping?



                March 2018 - Solved. Hawkeye added "WiFi Auto-Start" menu item. They have been very responsive to feature requests!
                Last edited by DigiSnapMark; 03-12-2018, 08:44 PM. Reason: Solved

                Comment


                • #14
                  Autoexec file for T5e Mic Port Version
                  Firmware Version: TI/UN7-171114-V5.1

                  S Fine - 100mbps
                  Fine - 80mbps
                  Normal - 60mbps

                  First 26 settings in the bitrate table changed with those settings

                  https://drive.google.com/open?id=1t8...qhyaGyTQrOSO14
                  Attached Files

                  Comment


                  • #15
                    Originally posted by Athiril View Post
                    Autoexec file for T5e Mic Port Version
                    Firmware Version: TI/UN7-171114-V5.1
                    Could you update the script for FW 180119 ?

                    And how can I find myself the starting address for bitrate settings?
                    I understand from nutsey post above:
                    You can dump memory with this command (you might want to increase the dump size from 16Mb):
                    savebin c:\dump.bin 0xA0000000 l 16777216
                    Then you have to find the offsets for bitrate values and change them with writeb/writel/writew commands.
                    but how can I find the offsets?
                    Last edited by MikLav; 03-17-2018, 12:25 PM.

                    Comment

                    Working...
                    X