Remote sensing of GoPro from its blinking LED?


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2023
    Location
    Cape Town, South Africa
    Posts
    26

    Default Remote sensing of GoPro from its blinking LED?

    Hi

    I am rather rusty on BASIC programming, having been absent from it for 40+ years. I have a remotely controlled GoPro, using third party remote control from YOCTOP This remote has been hacked and a PIC12F683 inserted. The pic "presses" the record button to start a recording and has to press it again to stop. The cycle I want is 3 seconds of recording time every minute.

    Mainloop:
    if CYCLE = 0 then goto Mainloop ' do not do any recording
    if cycle = 1 then gosub recording ' do the record cycle

    Recording:
    low RECPB ' Low Rec PB to start recording
    Pause 500 ' start recording for 3 seconds
    high RECPB ' High Rec PB after recording start
    for j = 1 to 3000 ' Loop count for rec timing
    pause 1
    next j
    low RECPB ' Low Rec PB to stop recording
    Pause 500 ' Stop recording after 3 seconds
    high RECPB ' High Rec PB after recording Stop
    for k = 1 to 57000 ' Pause for 57 seconds and repeat cycle.
    pause 1 '
    next k
    return

    goto mainloop

    end


    This works fine until I press the record button manually and then the system records for 57 seconds and skips 3 . . . .

    I need to detect if the cycle has been "inverted" and flash a red LED at me to manually press record again.

    The Yoctop remote has a green LED that gives feedback as follows: Steady ON means not recording. Blinking 0.5s off / 0.5s on means recording.

    What I thought of doing was to sample the on/off status of that LED over a moving window of 1.0 seconds. If on and off periods are similar (within 5%), it is recording. If on exceeds off (by more than 10%) it is not recording. Finally the pic must check if it is recording in the 57 sec when it is not supposed to record and then blink a red led at me. But I am stumped on how to do that elegantly in BASIC. Any and all help would be very much appreciated, thank you in advance.

    (A friend has built similar for me before and I used it to make these non-monetized YouTubes)

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    I think the remote YOCTOP has two way communication with your camera. If this is true, is it by IR, RF cable?

    It is the only way to be sure for the state your camera is in.

    Ioanins

  3. #3
    Join Date
    Mar 2023
    Location
    Cape Town, South Africa
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    It communicates with Wifi. (I can see the Yoctop on my Android wifi connections and that is the method of updating the Yoctop). Inside the Yoctop is an Espressif ESP32-WROOM-32U which is supposed to be "powerful, generic Wi-Fi + Bluetooth + Bluetooth LE MCUmodules that target a wide variety of applications, ranging from low-power sensor networks to the most
    demanding tasks, such as voice encoding, music streaming and MP3 decoding."

    I have no idea of the code in there.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    If the GoPro communication protocol is known, you may use a cheap ESP module and then try to write code to do just that. A PIC with WiFi is too much...

    There is a Basic Interpreter for ESP modules and you can find it here https://cicciocb.com/forum/viewforum.php?f=1 and in the forum a lot of people can help on the ESP thing.

    Ioannis

  5. #5
    Join Date
    Mar 2023
    Location
    Cape Town, South Africa
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    I think my first post has been misunderstood . . . I am not trying to do Wifi with the pic. The wifi module is still in the Yoctop and still works as original. I have put the pic on top of the system there already. Already I can push the record button with the pic and the pic sees the Yoctop status LED as an input.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    Oh, I see what you meant.

    OK, an idea is to have the internal clock set at HFINTOSC=8MHz, then prescaller at 1MHz. So the system clock will be 1MHz/4= 250KHz.

    Feed that clock to the Timer1 with a prescaller of 8. So the Timer1 will roll-over every 2 seconds.

    With the timer1 you may check the green LED for the time it stays ON and OFF and conclude if the GoPro is recording or not.

    Hope this helps.
    Ioannis

  7. #7
    Join Date
    Mar 2023
    Location
    Cape Town, South Africa
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    Thanks. It is going to take me a while to understand that.

  8. #8
    Join Date
    Aug 2011
    Posts
    412


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    In post 1, the GOTO MAINLOOP is in the wrong place. Move it to before the "recording" label.

    It may still not do what you're looking for, but fix that for sure.

  9. #9
    Join Date
    Mar 2023
    Location
    Cape Town, South Africa
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    Quote Originally Posted by tumbleweed View Post
    In post 1, the GOTO MAINLOOP is in the wrong place. Move it to before the "recording" label.

    It may still not do what you're looking for, but fix that for sure.
    I don't understand your logic. Would you mind giving me more information?

  10. #10
    Join Date
    Aug 2011
    Posts
    412


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Remote sensing of GoPro from its blinking LED?

    Here's what you have now (I removed some of the code for clarity)
    Code:
    Mainloop:
    if CYCLE = 0 then goto Mainloop ' just loop
    if cycle = 1 then gosub recording ' call the subroutine and then return to the next statement
    
    ' after executing the above for cycle= 1 you'll return here
    ' the next statement is the beginning of the "recording" subroutine
    ' it'll execute that, hit the 'return' and cause a problem since there was no matching call 
    
    Recording:
    ' do stuff
    return
    
    ' you'll never get here
    goto mainloop

    Without changing any of the code to test 'cycle', here's what it should look like
    Code:
    Mainloop:
    if CYCLE = 0 then goto Mainloop ' just loop
    if cycle = 1 then gosub recording ' call the subroutine and then return to the next statement
    
    goto mainloop     ' infinite loop back to main 
    
    Recording:
    ' do stuff
    return

Similar Threads

  1. Blinking LED will not Blink
    By andybarrett1 in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 24th September 2014, 21:20
  2. Timing out DT's Blinking Led
    By tazntex in forum General
    Replies: 3
    Last Post: - 28th May 2010, 17:41
  3. PIC16F819 LED not blinking
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 1st December 2009, 02:04
  4. blinking LED
    By kindows in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2009, 16:08
  5. Why is my LED not blinking?
    By Gary Goddard in forum General
    Replies: 14
    Last Post: - 1st January 2007, 20:23

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts