Giter VIP home page Giter VIP logo

cybergarage-upnp's Introduction

cybergarage-upnp

GitHub tag (latest SemVer)

Overview

cybergarage-upnp is a UPnP™ development package for Java developers. controls these protocols automatically, and supports to create your devices and control points quickly.

UPnP™ * architecture is an open network to enable discovery and control of networked devices and services, such as media servers and players at home.

UPnP™ * protocols are based on many standard, such as GENA, SSDP, SOAP, HTTPU and HTTP. Therefore you have to understand and implement these protocols to create your devices of UPnP™.

* UPnP ™ is a certification mark of the UPnP™ Implementers Corporation.

References

Repositories

Examples

cybergarage-upnp's People

Contributors

cybergarage avatar d0t451 avatar dependabot[bot] avatar diegomoriarty avatar fetzerms avatar klikaservices avatar meilarium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cybergarage-upnp's Issues

getNNode() NullPointException!!!

java.lang.NullPointerException
Attempt to invoke virtual method 'int org.cybergarage.xml.Node.getNNodes()' on a null object reference

org.cybergarage.upnp.event.NotifyRequest.getPropertyList(NotifyRequest.java:191)
org.cybergarage.upnp.ControlPoint.httpRequestRecieved(ControlPoint.java:577)
org.cybergarage.http.HTTPServer.performRequestListener(HTTPServer.java:212)
org.cybergarage.http.HTTPServerThread.run(HTTPServerThread.java:48)

Should I setXMLParser() in anywhere ?

FATAL EXCEPTION after WiFi OFF/ON operate ,then turn OFF/ON DLNA device

Here is my step:

  1. Start search will do this --> controlpoint.addDevicesChangeListenner(),controlpoint.start() controlpoint.search();
  2. WiFi Turn OFF then turn ON will do this -->controlpoint.stop(),controlpoint.start() controlpoint.search();
    3.Then in the same WiFi environment , turn OFF/ON my DLNA device by turns, few times later it crash like the bellow logs:

E/AndroidRuntime: FATAL EXCEPTION: Cyber.SSDPNotifySocket/fe80::3abc:1aff:fef4:b81c%wlan0:1900 -> ff02::c:1900
Process: com.jingxun.upai, PID: 1122
java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
at java.util.Vector.arrayIndexOutOfBoundsException(Vector.java:907)
at java.util.Vector.elementAt(Vector.java:328)
at java.util.Vector.get(Vector.java:442)
at org.cybergarage.xml.NodeList.getNode(NodeList.java:28)
at org.cybergarage.upnp.ControlPoint.getDevice(ControlPoint.java:307)
at org.cybergarage.upnp.ControlPoint.removeDevice(ControlPoint.java:347)
at org.cybergarage.upnp.ControlPoint.removeDevice(ControlPoint.java:357)
at org.cybergarage.upnp.ControlPoint.notifyReceived(ControlPoint.java:509)
at org.cybergarage.upnp.ssdp.SSDPNotifySocket.run(SSDPNotifySocket.java:138)
at java.lang.Thread.run(Thread.java:818)

Mobile Local Video

How to Project Mobile Local Video?
(如何投屏手机本地视频)

Out of Memory!!!!

Hello guys:
I have a problem when using cybergarage lib . The detail error log as follows:

FATAL EXCEPTION: Cyber.HTTPServer//172.16.171.202:8058
08-14 11:12:37.647 15730 1550 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Out of memory
08-14 11:12:37.647 15730 1550 E AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method)
08-14 11:12:37.647 15730 1550 E AndroidRuntime: at java.lang.Thread.start(Thread.java:753)
08-14 11:12:37.647 15730 1550 E AndroidRuntime: at org.cybergarage.http.HTTPServer.run(HTTPServer.java:243)
08-14 11:12:37.647 15730 1550 E AndroidRuntime: at java.lang.Thread.run(Thread.java:784)
08-14 11:12:37.651 15730 1548 E AndroidRuntime: FATAL EXCEPTION: Cyber.HTTPServer//fe80::3a37:8bff:feb4:7676%wlan0:8058

08-14 11:12:37.651 15730 1548 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Out of memory
08-14 11:12:37.651 15730 1548 E AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method)
08-14 11:12:37.651 15730 1548 E AndroidRuntime: at java.lang.Thread.start(Thread.java:753)
08-14 11:12:37.651 15730 1548 E AndroidRuntime: at org.cybergarage.http.HTTPServer.run(HTTPServer.java:243)
08-14 11:12:37.651 15730 1548 E AndroidRuntime: at java.lang.Thread.run(Thread.java:784)

I guess that it is related to searching .However, I have no way to stop it .Anyone has good idea?

Any new version?

two years have passed since the last release, is there a new version?
Looking forward to new release

JavaDoc comments

The current comments are non-javadoc and therefore do not help when developing. It requires quite some time to actually step into the code to see which effect specific params have.

It would be great to have javadoc compliant comments on methods and classes to ease the development using any Java IDE.

Socket null issue while discovering speakers in android pie devices.

So currently i am trying to connect with speakers which works pretty well for the devices below android Pie. But for the particular devices (Samsung Galaxy S10, vivo,Samsung Galaxy A50) with android pie version i am getting null socket which leads to speakers not found for these particular devices.

Also, I came across weird scenario: when I turned on airplane mode, speaker are getting detected. which is not the correct solution for me.

Discovery Issues In Android and Cling-Based Devices

I have put together a basic ControlPoint and MediaRenderer, both of which are running on my MacBook. While the ControlPoint is able to see all of the devices in my house (so far), other ControlPoints do not see the MediaRenderer. Specifically, the built-in music players on the Samsung Galaxy S5 and LG V10, as well as other Android Apps, such as BubbleUPnP and UPnP Scanner. The latter two are built on the Cling UPnP stack. A third Android App, AirWire, does find the MediaRenderer, and is able to control it without issue.

At first I thought this might be a problem restricted to Cling-based devices discovering CyberGarage devices, but since the Android music players are unable to find them either, it appears to be a broader issue.

Can't play video for some tv

Hi!
For some tv i can't play video. This happened because services sometimes include full path for SCPDURL, sontrolURL, eventSubURL and sometimes include path relative of description file path.
Description file path: /dmr/ddd.xml

urn:schemas-upnp-org:service:AVTransport:1
urn:upnp-org:serviceId:AVTransport
/dmr/sdd_2.xml
/dmr/control_2
/dmr/event_2

Can you help me?
Log:
11-19 13:42:29.571: I/System.out(28780): CyberGarage warning : java.io.FileNotFoundException: /dmr/sdd_2.xml: open failed: ENOENT (No such file or directory)
11-19 13:42:29.571: I/System.out(28780): org.cybergarage.xml.ParserException: java.io.FileNotFoundException: /dmr/sdd_2.xml: open failed: ENOENT (No such file or directory)
11-19 13:42:29.571: I/System.out(28780): at org.cybergarage.xml.Parser.parse(Parser.java:107)
11-19 13:42:29.571: I/System.out(28780): at org.cybergarage.upnp.Service.getSCPDNode(Service.java:392)
11-19 13:42:29.576: I/System.out(28780): at org.cybergarage.upnp.Service.getSCPDNode(Service.java:441)
11-19 13:42:29.576: I/System.out(28780): at org.cybergarage.upnp.Service.getActionList(Service.java:471)
11-19 13:42:29.576: I/System.out(28780): at org.cybergarage.upnp.Service.getAction(Service.java:490)

Unable to getAction for Wemo devices

I have been using this code to control Wemo devices, however run into an issue when calling Device.getAction(); which returns null and results in an inability to control the device.

The root of the issue appears to be in org.cybergarage.upnp.Device in the getAbsoluteURL(String, String, String) method. The method is called with:
urlString="/timesyncservice.xml"
baseURLString=""
locationURLStr="http://:49153/setup.xml"

The method returns a string: "http://:49153/setup.xml/timesyncservice.xml", which is incorrect. It should return "http://:49153/timesyncservice.xml". It appears the only validation that is being performed is to look for a MalformedURLException. My fix on the local copy of my code (attached) is to attempt to open the URL prior to returning the string to check for a response code of 200. Doing so appears to resolve my issue, though this approach breaks the test in org.cybergarage.upnp.DeviceTest as the testDeviceAbsoluteURL() method need to be able to connect to an actual device.
Device.txt

Crash

image

Is there a solution to this problem? It has affected the use

toUpperCase without locale

in org.cybergarage.http.HTTPHeader.class line 66, "String bigName = name.toUpperCase();" . You should call to upperCase with locale parameter to get right response from getValue function. For example;

"Location".toUpperCase() (in Turkish) = "LOCATİON"

add us locale to solve problem

FYI - copyright attribution not specified in belkin product

Just a friendly heads up, a Belkin app for a product called wemo was failing on Android, so I examine the log with logcat and found that it's calling code from this project. I read your license to see it was the 3 clause BSD. I then read the wemo legal text to find that they direct users to visit belkin.com for open source copyright attribution. When I visited their site, I found their open source attribution page and the requested copyright attribute for this project was not listed. They don't offer code for this product, but this likely falls under the redistribution of binary form clause of your license.

Here's the stack trace from their product:

11-28 21:49:43.511 20929 21217 I System.out: CyberGarage warning : Thread: 544: Machine is not on the network
11-28 21:49:43.512 20929 21217 I System.out: java.net.SocketException: Machine is not on the network
11-28 21:49:43.513 20929 21217 I System.out:    at java.net.NetworkInterface.getAll(Native Method)
11-28 21:49:43.513 20929 21217 I System.out:    at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:333)
11-28 21:49:43.513 20929 21217 I System.out:    at org.cybergarage.net.HostInterface.getNHostAddresses(HostInterface.java:107)
11-28 21:49:43.513 20929 21217 I System.out:    at org.cybergarage.http.HTTPServerList.open(HTTPServerList.java:85)
11-28 21:49:43.513 20929 21217 I System.out:    at org.cybergarage.http.HTTPServerList.open(HTTPServerList.java:109)
11-28 21:49:43.514 20929 21217 I System.out:    at org.cybergarage.upnp.ControlPoint.start(ControlPoint.java:1200)
11-28 21:49:43.514 20929 21217 I System.out:    at org.cybergarage.upnp.ControlPoint.start(ControlPoint.java:1323)
11-28 21:49:43.514 20929 21217 I System.out:    at com.belkin.wemo.cache.devicelist.DeviceListManager.initControlPoint(DeviceListManager.java:1073)
11-28 21:49:43.514 20929 21217 I System.out:    at com.belkin.wemo.cache.devicelist.DeviceListManager.recreateControlPoint(DeviceListManager.java:3935)
11-28 21:49:43.514 20929 21217 I System.out:    at com.belkin.wemo.cache.devicelist.runnable.MSearchRequestRunnable.sendMSearchRequest(MSearchRequestRunnable.java:48)
11-28 21:49:43.515 20929 21217 I System.out:    at com.belkin.wemo.cache.devicelist.runnable.MSearchRequestRunnable.run(MSearchRequestRunnable.java:39)
11-28 21:49:43.515 20929 21217 I System.out:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
11-28 21:49:43.515 20929 21217 I System.out:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
11-28 21:49:43.515 20929 21217 I System.out:    at java.lang.Thread.run(Thread.java:761)

Here is their copyright attribution page. wemo products are not listed. I could not find a separate wemo legal page.
http://www.belkin.com/us/support-article?articleNum=97444

Sorry to bother you if you don't want to enforce the license. I just figured I'd bring it to your attention.

Multithreaded Synchronization Crash

I posted this in the forum, then realized I should open an issue:

I've been seeing the following crash in the field with the CyberLink for Java code:

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at java.util.Vector.arrayIndexOutOfBoundsException(Vector.java:907)
at java.util.Vector.elementAt(Vector.java:328)
at java.util.Vector.get(Vector.java:442)
at org.cybergarage.xml.NodeList.getNode(GraceRemote:28)
at org.cybergarage.upnp.ControlPoint.getDeviceList(GraceRemote:313)
at org.cybergarage.upnp.ControlPoint.renewSubscriberService$1349ef(GraceRemote:860)
at org.cybergarage.upnp.ControlPoint.renewSubscriberService(GraceRemote:871)
at org.cybergarage.upnp.control.RenewSubscriber.run(GraceRemote:69)
at java.lang.Thread.run(Thread.java:856)

This is occurring on the renewsubscriber thread. There's another thread for removing expired devices. The renew iterates through the devNodeList, the remove deletes entries from the devNodeList and there's no synchronization between the two. Has anyone else seen this problem? Is it as simple as synchronizing the getDevice() and removeDevice() calls? I'm only seeing this in anonymous crash reports, and it's not common, so reproducing and testing isn't an option.

Crash for zero-length packets

{Cyber.SSDPNotifySocket/192.168.1.49:1900 -> 239.255.255.250:1900} {IllegalArgumentException} (@java.io.BufferedReader::109) java.lang.IllegalArgumentException: size <= 0 at
java.io.BufferedReader.(BufferedReader.java:109) at java.io.LineNumberReader.(LineNumberReader.java:59)
at org.cybergarage.http.HTTPHeader.getValue(SourceFile:120)
at org.cybergarage.http.HTTPHeader.getValue(SourceFile:126)
at org.cybergarage.upnp.ssdp.SSDPPacket.getHost(SourceFile:138)
at org.cybergarage.upnp.ssdp.SSDPPacket.getHostInetAddress(SourceFile:193)
at org.cybergarage.upnp.ssdp.SSDPNotifySocket.run(SourceFile:134)
at java.lang.Thread.run(Thread.java:818)

ControlPoint.start(target) not discovering the devices on Android Q

I am trying to discover my target device from my android application. It worked so far. Now I am trying this on Android Q and my target is not getting discovered.
The same code discovers my target device on lower versions of android (P, O). No errors thrown.
I can see the search packet being broadcasted.

My target device does get listed if I remove the ST: parameter from my search on Anroid Q. I mean ssdp:all lists it. When I add the target parameter to the start() method, it doesn't list my target device. What could be going wrong ?
Any help is appreciated.

service.getAction is return null

Device.java 270 line
String absUrl = locationURLStr + urlString;

need change to

URL locationURL = new URL(locationURLStr);
// 重新拼接url
String absUrl = locationURL.getProtocol() + "://" + locationURL.getHost() + ":" + locationURL.getPort() + urlString;

service.getAction can be work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.