After playing around for a bit, I've gotten this far:
I enabled 'developer' mode on my onn device
I confirmed that adb sees and connects to my device via IP by running: adb -s 192.168.1.177 shell input keyevent KEYCODE_HOME from the docker container
and seeing my device go 'home'
I created a custom channel and the guide populates with a few Youtube TV channels
I attempt to 'watch' from channels and it just closes the window without streaming anything
2023/08/08 10:59:18 [EXECUTE] Finished running .//prebmitune.sh in 920.425ยตs
2023/08/08 10:59:18 [ERR] Failed to run pre script: fork/exec .//prebmitune.sh: no such file or directory 192.168.1.177:5555
version: '3.9'
services:
ah4c:
image: bnhf/ah4c:latest
container_name: ah4c
hostname: ah4c
dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
ports:
- 5037:5037 # Port used by adb-server
- 7654:7654 # Port used by this ah4c proxy
environment:
- IPADDRESS=${IPADDRESS} # Hostname or IP address of this ah4c extension to be used in M3U file (also add port number if not in M3U)
- NUMBER_TUNERS=${NUMBER_TUNERS} # Number of tuners you'd like defined 1, 2, 3 or 4 supported
- TUNER1_IP=${TUNER1_IP} # Streaming device #1 with adb port in the form hostname:port or ip:port
- TUNER2_IP=${TUNER2_IP} # Streaming device #2 with adb port in the form hostname:port or ip:port
- TUNER3_IP=${TUNER3_IP} # Streaming device #3 with adb port in the form hostname:port or ip:port
- TUNER4_IP=${TUNER4_IP} # Streaming device #4 with adb port in the form hostname:port or ip:port
- ENCODER1_URL=${ENCODER1_URL} # Full URL for tuner #1 in the form http://hostname/stream or http://ip/stream
- ENCODER2_URL=${ENCODER2_URL} # Full URL for tuner #2 in the form http://hostname/stream or http://ip/stream
- ENCODER3_URL=${ENCODER3_URL} # Full URL for tuner #3 in the form http://hostname/stream or http://ip/stream
- ENCODER4_URL=${ENCODER4_URL} # Full URL for tuner #4 in the form http://hostname/stream or http://ip/stream
- STREAMER_APP=${STREAMER_APP} # Streaming device name and streaming app you're using in the form scripts/streamer/app (use lowercase with slashes between as shown)
- CHANNELSIP=${CHANNELSIP} # Hostname or IP address of the Channels DVR server itself
#- ALERT_SMTP_SERVER="smtp.gmail.com:587"
#- ALERT_AUTH_SERVER="smtp.gmail.com"
#- ALERT_EMAIL_FROM=""
#- ALERT_EMAIL_PASS=""
#- ALERT_EMAIL_TO=""
#- ALERT_WEBHOOK_URL=""
- TZ=${TZ} # Your local timezone in Linux "tz" format
volumes:
- /data/ah4c/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
- /data/ah4c/m3u:/opt/m3u # m3u files will be stored here and hosted at http://<hostname or ip>:7654/m3u for use in Channels DVR - Custom Channels settings
- /data/ah4c/adb:/root/.android # Persistent data directory for adb keys
restart: unless-stopped
(note, I'm not mounting a /data directory atm.. should I?)
and the env vars:
Hmmm... Everything looks correct so far. What happens if you exec into the container and run ./scripts/onn/youtubetv/prebmitune.sh from the /opt directory?
I think I figured out the problem. The scripts do not have proper line endings, they're DOS, not UNIX..
Running dos2unix prebmitune.sh fixed it, and...
naturally got me to the next error:
2023/08/08 12:26:40 [ERR] Failed to run start script: fork/exec ./scripts/onn/youtubetv/bmitune.sh: no such file or directory
so now I'm converting all three scripts in the folder..
UPDATE: I've converted all three scripts to the 'proper' UNIX format, and I now see a stream, but unfortunately it's not tuning, it's just the HOME page.
Excellent catch -- I see that in the source now too. These were some of the original sample scripts, so they likely won't be right for you anyway, but it'll be nice to at least see more meaningful errors.
Check out the mecool/youtubetv scripts on Github, that should be a better starting point than the onn/youtube scripts. The onn scripts are samples from the early days of this project. You can also look at my firetv/directv scripts, although those are oriented towards KEYEVENT style tuning rather than deep links.