Home › Forums › BreakawayOne › Bypass Status
- This topic has 19 replies, 3 voices, and was last updated 3 years, 1 month ago by MrKlorox.
-
AuthorPosts
-
October 8, 2021 at 7:41 am #16642maczroolParticipant
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!
October 8, 2021 at 7:54 am #16643MrKloroxParticipantI 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!
October 8, 2021 at 10:34 am #16644maczroolParticipantThank you so much! If there is a command to turn the bypass function on and off that would be even better.
October 8, 2021 at 4:38 pm #16645MilkyKeymasterYou 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.
October 9, 2021 at 5:49 am #16647maczroolParticipantThanks for your invaluable contribution Milky! I’ll give these a shot and see how they go.
October 9, 2021 at 6:25 am #16648maczroolParticipantI 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!
October 9, 2021 at 9:11 am #16649maczroolParticipantI’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.
October 9, 2021 at 7:53 pm #16650MilkyKeymasterThe 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.
October 10, 2021 at 4:39 am #16651maczroolParticipantThanks! 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.
October 10, 2021 at 5:47 am #16652maczroolParticipantThe 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=1October 10, 2021 at 6:52 am #16653maczroolParticipantFixed 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=1It 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!
October 10, 2021 at 1:56 pm #16656MilkyKeymasterGlad 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.
October 11, 2021 at 6:38 am #16657maczroolParticipantGlad 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.
October 11, 2021 at 6:45 am #16658maczroolParticipantDo 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?
October 11, 2021 at 2:33 pm #16660MilkyKeymasterI 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.
-
AuthorPosts
- You must be logged in to reply to this topic.