Home Forums BreakawayOne Bypass Status

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #16642
    maczrool
    Participant

    I’d like to build a PC-based box to integrate into a home stereo but need a way to check the status of bypass so that it can reliably turned on and off. Is there a way to programmatically read the current bypass status? I’ve tried getting AutoHotkey to read the pixels at the location of the bypass on-screen indicator, but that depends on coordinates and color values which depending on window position or BAO screen displayed, may not be present as expected. I just need a command I could use that returns the bypass current status. Does such exist perhaps with the BARemote?

    Thanks!

    #16643
    MrKlorox
    Participant

    I think you would want to somehow read the status of “/hd1/proc/bypass_proxy=” 1 for bypass enabled. I think Milky might be able to help you nail down how to do this a little better than I could. Best of luck!

    #16644
    maczrool
    Participant

    Thank you so much! If there is a command to turn the bypass function on and off that would be even better.

    #16645
    Milky
    Keymaster

    You just need two little batch programs.

    Bypass_OFF.bat would have the following line in it.

    
    REM Set Bypass Processing option to OFF
    curl --silent --output nul http://{YOUR_PC_NAME_HERE}:8282/parameter/hd1/proc/bypass_proxy=0

    Bypass_ON.bat would have this.

    REM Set Bypass Processing option to ON
    curl --silent --output nul http://{YOUR_PC_NAME_HERE}:8282/parameter/hd1/proc/bypass_proxy=1

    If you are using AHK you could execute the CURL line using RunWait, like this.
    RunWait, curl --silent --output nul http://OTSBOX:8282/parameter/hd1/proc/bypass_proxy=0,, hide

    to get the current status is a little trickier, but you could use a command to write the status to a file.

    	; Get current status of Bypass 
    
    	FileDelete, C:\OtsLabs\BypassStatus.txt
    
        	URLDownloadToFile, http://OtsBox:8282/parameter/hd1/proc/bypass_proxy?get, C:\OtsLabs\BypassStatus.txt
        	FileReadLine, BypassStatus, C:\OtsLabs\BypassStatus.txt, 1

    You could then test the value of the field BypassStatus. 1 = Bypass ON, 0 = Bypass OFF.

    • This reply was modified 3 years, 1 month ago by Milky.
    • This reply was modified 3 years, 1 month ago by Milky.
    #16647
    maczrool
    Participant

    Thanks for your invaluable contribution Milky! I’ll give these a shot and see how they go.

    #16648
    maczrool
    Participant

    I can’t seem to get the batch files working. Is there anything I need to have running besides BreakawayOne? Any particular configuration I need to get BA to accept commands? All I get is Could not resolve host. Tried using the PC name with and without the brackets as well as the PC’s IP address with and without brackets but no luck. Thanks so much!

    #16649
    maczrool
    Participant

    I’m making progress. It seems I needed to add the host IP to the “HTTP Port:8282” Box. Now I can reach the server. Batch files still report unable to resolve host though.

    #16650
    Milky
    Keymaster

    The computer name should not include the brackets. What happens if you type http://IP address or computer name:8282 into a browser? It should open the webserver page, where you can scroll through all the command options.

    BA1 has an inbuilt webserver at port 8282.

    #16651
    maczrool
    Participant

    Thanks! That’s what I got working. I can control BA1 with a browser but the batches won’t resolve the host. Even when I use the IP it says that so I’m not sure what resolving there is to do.

    #16652
    maczrool
    Participant

    The batches work if I take the switches you have in there out. So this works:

    REM DISABLE BreakAwayOne
    curl http://192.168.1.114:8282/parameter/hd1/proc/bypass_proxy=1

    #16653
    maczrool
    Participant

    Fixed it! Needed an additional “-” for each switch so:

    REM DISABLE BreakAwayOne
    curl –silent –output nul http://192.168.1.114:8282/parameter/hd1/proc/bypass_proxy=1

    It seems the forum software is removing the extra “-” so it does not publish correctly. Each switch requires two hyphens preceding it even if the example code does not appear that way.

    Thanks again for your help!

    • This reply was modified 3 years, 1 month ago by maczrool.
    • This reply was modified 3 years, 1 month ago by maczrool.
    #16656
    Milky
    Keymaster

    Glad you got it sorted! I copied and pasted the code from my test program, so I was sure it should work, but the forum software tampered with my code.

    If you are familiar with AHK, you could define some buttons to execute the code, and even interrogate the current status and display a message.

    #16657
    maczrool
    Participant

    Glad you got it sorted! I copied and pasted the code from my test program, so I was sure it should work, but the forum software tampered with my code.

    Thanks for going to all that trouble. I noticed it corrupts the code too. I see there is code flag in the options in the post window. Perhaps that would have helped.

    If you are familiar with AHK, you could define some buttons to execute the code, and even interrogate the current status and display a message.

    Yes I am semi-familiar with it. I have everything working in AHK now. It writes to a file as you suggested and then at startup uses the file to restore the previous state. I also light a Blink1 USB LED when BA1 is active and use a single USB key dongle to toggle between on and off. In the future I may build a circuit to electrically switch the PC audio hardware out of the chain when BA1 is inactive.

    #16658
    maczrool
    Participant

    Do you know if it is possible to get BARemote to automatically connect to the BA1 service and open into full display mode or to issue a command to do so?

    #16660
    Milky
    Keymaster

    I edited my original post to include the “code” option, and it definitely looks better.

    I’m not aware of any command line options to launch BARemote and open to a particular page.

    Maybe AHK could be your friend again. Unless you have several copies of BA1, there would only be one default connection showing, so, using Window Spy, you could plot a mouse click position over the “Connect” button and it should automatically connect.

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.