2020-04-01, 03:21 AM
there is just a jar and a bat file in the link
2020-04-01, 03:21 AM
there is just a jar and a bat file in the link
2020-04-01, 03:29 AM
Let me know if this works
Try the DISCOVERY and other steps and this in theory should put the extras in /var/opt/nextpvr python3 opendct.py INSTALL Martin
2020-04-01, 03:33 AM
Ok I will.
I was only meaning that I followed only this thread on my install. The only place I strayed was on the xml files I created to make the device show up. I altered the mac and tuner info to match the values I had in my files. Since I have 2 pcie cards. one 4 and one 6. I created 10 files so there was a file per available system tuner <extras> <channel name="{channel-name}"> <command>bash</command> <args>-c "/var/opt/nextpvr/scripts/opendct.sh {channel} \"DCT-Ceton InfiniTV Ethernet (00-80-8d-8a) Tuner 2\""</args> </channel> </extras>
2020-04-01, 07:05 AM
I don't have a Ceton device so I depend on users to finalize this thread before I created a wiki combining both together.
I will need to modify the script to support 2 Ceton devices with 4 and 6 tuners I never contemplated that requirement. Could you send me the output from DISCOVERY Martin
2020-04-01, 09:20 AM
One thing the script did was create the files in the script directory where the py resides. Nextpvr didnt pick them up here
I created a directory in the root of the install called extras as described on the windows installer. It didnt pick them up here either I put them in the root of the directory where i put my originals and it didnt pick them up either When I moved my files they still showed up in the list but the devices said unavailible. So I went back and manually edited my files to match the changes the new files made which was really just the port added on by the looks of it. It made 10 files with this naming convention "this was the actual linux file name it gave" c:\users\public\npvr-data\extras-DCT-Ceton InfiniTV PCIe (00-80-0d-5a) Tuner 1 inside each file it looked like this only changes I noticed in the files is the change on the ports and the tuners <extras> <channel name="{channel-name}"> <command>bash</command> <args>-c "/var/opt/nextpvr/scripts/opendct.sh {channel} \"DCT-Ceton InfiniTV PCIe (00-80-0d-5a) Tuner 1\" 7827\"</args> </channel> </extras>
2020-04-01, 09:29 AM
However on any channel I tune in the web app be it an antenna or cable card it says
"Failed to start requested stream" And I get this error "There was a problem adding the device: 192.168.0.3:5004" when I try to use plex with this app as a frontend https://github.com/rogueosb/npvrProxy
2020-04-01, 10:08 AM
Sounds like you used INSTALLW not INSTALL
The port should be the only thing that will change if you are running one instance of opendct. That is what I was confirming with my request for the DISCOVERY. If it made 10 files that answers that Could you post the contents of the scripts/opendct.sh file from the scripts folder and send the zipped NextPVR logs. I am assuming you updated the jar file with the latter version so could you send the zipped opendct.log file too please No point in trying plex at this point Martin
2020-04-01, 10:33 AM
Install command errored out and would not execute. the installw ran fine. Yes I updated the jar as requested.
# Send data if argv[1] == 'DISCOVERY': discovery() sys.exit() elif argv[1] == 'INSTALLW' or argv[1] == 'INSTALL': message = 'PROPERTIES' filter = argv[2] elif argv[1] == 'PROPERTIES' or argv[1] == 'NOOP' or argv[1] == 'VERSION' or argv[1] == 'INSTALLW': message = argv[1] else: tuner = argv[2] message = ''.join((argv[1],' ', tuner)) if argv[1] == 'START': streamingPort = 0 if len(argv)==5: if '\\' in argv[4] or '/' in argv[4]: #pass filename message = message + ''.join(('|',argv[3],'|','12345678','|',argv[4],'|Great')) else: message = message + ''.join(('|',argv[4],'|',argv[3],'|12345678|stdout|Great')) streamingPort = argv[4] else: message = message + ''.join(('|','7819','|',argv[3],'|12345678|stdout|Great')) streamingPort = '7819' if streamingPort != 0: if (sys.stdout.isatty() == False): mediaServerThread = threading.Thread(target=media_server, args=(streamingPort,)) mediaServerThread.daemon = True mediaServerThread.start() else: print ('stdout not redirected', file=sys.stderr) sys.exit(1) payload = sendMessage(message) print (payload, file=sys.stderr) if 'mediaServerThread' in locals(): if payload.startswith('OK'): mediaServerThread.join() else: sys.exit() #print('after server', file=sys.stderr) if argv[1] == 'PROPERTIES' or argv[1] == 'INSTALLW' or argv[1] == 'INSTALL' : devices = re.findall('video_capture_device_name=(.+?)\r',payload,re.S|re.DOTALL) xml = sys.stdout openport = 7819 for device in devices: if argv[1] == 'INSTALLW' or argv[1] == 'INSTALL': if filter not in device: continue if argv[1] == 'INSTALLW': xml = open('c:\\users\\public\\npvr-data\\extras-'+device+'.xml','w',newline='\r\n') else: xml = open('/var/opt/nextpvr/extras-'+device+'.xml','w',newline='\n') xml.write('<extras>\n') xml.write(' <channel name="{channel-name}">\n') if sys.platform == 'win32': xml.write(' <command>cmd</command>\n') xml.write(' <args>/c ""C:\\Users\\Public\\NPVR-data\\scripts\\opendct.bat" {channel} "' + device + '" ' + str(openport) + '"</args>\n') else: xml.write(' <command>bash</command>\n') xml.write(' <args>-c "/var/opt/nextpvr/scripts/opendct.sh {channel} \\"'+ device + '\\" ' + str(openport) + '\\"</args>\n') xml.write(' </channel>\n') xml.write('</extras>\n') if argv[1] == 'INSTALLW' or argv[1] == 'INSTALL': xml.close() openport += 1 finally: print ('Exit', file=sys.stderr) def sendMessage(message): print(message, file=sys.stderr) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) server_address = (server,port) try: sock.connect(server_address) message = (message +'\n').encode('utf-8') sock.send(message) payload = '' while True: data = sock.recv(1024) if not data: break payload = payload + data.decode() if (len(data) < 1024): break sock.close() except Exception as e: payload = str(e) return payload def media_server(sPort): # get the hostname global tuner host = socket.gethostname() host = server port = int(sPort) sockMediaServer = socket.socket() # get instance # look closely. The bind() function takes tuple as argument sockMediaServer.bind((host, port)) # bind host address and port together sockMediaServer.listen(1) print ('listening', file=sys.stderr) isPiped = True connMediaServer, address = sockMediaServer.accept() # accept new connection print ('waiting', file=sys.stderr) #print ('listening') #print("Connection from: " + str(address)) i = 0 while True: # receive data stream. it won't accept data packet greater than 1024 bytes data = connMediaServer.recv(1024) if not data: # if data is not received break break try: #print(data) command = data[:data.find(b'\r')] received = str(command.decode()).split() #print(received, file=sys.stderr) if received[0] == 'WRITE': try: total = int(received[2]) - len(data) + len(command) + 2 if isPiped: sys.stdout.buffer.write(data[data.find(b'\n')+1:]) while total > 0: payload = connMediaServer.recv(total) if not payload: break if isPiped: sys.stdout.buffer.write(payload) #print(len(payload), file=sys.stderr) total -= len(payload) #print (received,len(payload)) except IOError as e: if e.errno == errno.EPIPE or e.errno == errno.EINVAL: isPiped = False message = ''.join(('STOP',' ',tuner)) sendMessage(message) continue print (e, file=sys.stderr) except Exception as e: print (e, file=sys.stderr) isPiped = False continue elif received[0] == 'WRITEOPEN': data = 'OK\r\n' connMediaServer.send(data.encode()) else: print(data, file=sys.stderr) if received[0] == 'CLOSE': command = data[data.find(b'\n')+1:] if len(command) > 2: received = str(command.decode()).split() print(received, file=sys.stderr) if received[0] == 'QUIT': break except Exception as e: print(command, file=sys.stderr) print(e, file=sys.stderr) print ( traceback.format_exc(), file=sys.stderr) break data = 'OK\r\n' if (i==1000): print ('closing', file=sys.stderr) data = 'NON_MEDIA\r\n' connMediaServer.send(data.encode()) # send data to the client #conn.close() #break elif isPiped: connMediaServer.send(data.encode()) # send data to the client print('Exit media server', file=sys.stderr) connMediaServer.close() # close the connection def discovery(): import struct multicast_group = ('255.255.255.255', 8271) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #create UDP socket ttl = struct.pack('b',5) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.settimeout(5) message = b'STN\x04\x01\x00' + bytearray(26) sent = sock.sendto(message, multicast_group) # Look for responses from all recipients while True: try: data, addr = sock.recvfrom(32) print (addr) print (data) print (((data[6] & 0xFF) << 8) + (data[7] & 0xFF)) except socket.timeout: print('Timed out, no more responses') break if __name__== "__main__": main(sys.argv)
2020-04-01, 12:32 PM
(This post was last modified: 2020-04-01, 12:37 PM by mvallevand.)
INSTALL likely requires sudo.
I asked for the sh file not the py file and the logs. Martin
2020-04-01, 04:46 PM
opendct=/var/opt/nextpvr/scripts/opendct.py
python3 $opendct STOP "$2" python3 $opendct START "$2" $1 2>/dev/null Where are the logs ? In the log directory there are only logs for the 3 wintv hvr1600's, 1 wintv quadhd, and 1 wintv dualhd. I also have in the system |
|