Avatar for ingo

ingo

Member since May 2022 • Last active Dec 2022
  • 3 conversations
  • 13 comments

Most recent activity

  • in Bangle.js
    Avatar for ingo

    @rullen, this is certainly the error that is described here:
    http://forum.espruino.com/conversations/­379050/

  • in Bangle.js
    Avatar for ingo

    The other topic seemed to go in a different direction, so I opened this one. Turned out differently now though. So this one could be closed.

  • in Bangle.js
    Avatar for ingo

    this is actually the first I've heard of the tape coming off

    on my watch the tape came off already after 2 months, a piece of new tape helped

  • in Bangle.js
    Avatar for ingo

    I also have the error mainly in GadgetBridge and Chrome in Android.
    I tried this with Chrome and tried to debug via the computer (https://www.addictivetips.com/android/ge­t-web-console-log-chrome-for-android/). But have not found a clear indication for the error.

    I also tried this in GadgetBridge via Android Studio using LogCat. I couldn't see any obvious errors there either. The json string seems to arrive. I see at least log output of type UART RX with a json containing all my apps.

    When I have more time, I'll take another closer look. Probably not until the weekend :(

  • in Bangle.js
    Avatar for ingo

    With the URL "https://banglejs.com/reference" I get the following exception:

    org.xml.sax.SAXParseException: unterminated entity ref
    (position:ENTITY_REF @1:1230 in java.io.StringReader@299f0e3) at
    org.apache.harmony.xml.parsers.DocumentB­uilderImpl.parse(DocumentBuilderImpl.jav­a:147)
    at org.apache.xpath.jaxp.XPathImpl.evaluate­(XPathImpl.java:474) at
    org.apache.xpath.jaxp.XPathImpl.evaluate­(XPathImpl.java:521) at
    gutzeit.com.xpathtest.MainActivity.lambd­a$testAsync$0(MainActivity.java:123)
    at
    gutzeit.com.xpathtest.MainActivity$$Exte­rnalSyntheticLambda0.run(Unknown
    Source:0) at
    java.util.concurrent.ThreadPoolExecutor.­runWorker(ThreadPoolExecutor.java:1167)
    at
    java.util.concurrent.ThreadPoolExecutor$­Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)
    --------------- linked to ------------------ javax.xml.xpath.XPathExpressionException­:
    org.xml.sax.SAXParseException: unterminated entity ref
    (position:ENTITY_REF @1:1230 in java.io.StringReader@299f0e3) at
    org.apache.xpath.jaxp.XPathImpl.evaluate­(XPathImpl.java:479) at
    org.apache.xpath.jaxp.XPathImpl.evaluate­(XPathImpl.java:521) at
    gutzeit.com.xpathtest.MainActivity.lambd­a$testAsync$0(MainActivity.java:123)
    at
    gutzeit.com.xpathtest.MainActivity$$Exte­rnalSyntheticLambda0.run(Unknown
    Source:0) at
    java.util.concurrent.ThreadPoolExecutor.­runWorker(ThreadPoolExecutor.java:1167)
    at
    java.util.concurrent.ThreadPoolExecutor$­Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923) Caused by:
    org.xml.sax.SAXParseException: unterminated entity ref
    (position:ENTITY_REF @1:1230 in java.io.StringReader@299f0e3) at
    org.apache.harmony.xml.parsers.DocumentB­uilderImpl.parse(DocumentBuilderImpl.jav­a:147)
    at org.apache.xpath.jaxp.XPathImpl.evaluate­(XPathImpl.java:474) ...
    6 more

    I was interested to see if this works for anyone. It would be great if someone could try this out.

  • in Bangle.js
    Avatar for ingo

    @myxor, thank you for your response.

    I'll have another look this evening.

    But there were different exceptions depending on the page I wanted to load.
    If you open the html, for example with firstobject XML editor, you will also see structural errors due to the embedded javascript. As already written above, very simple HTML/XML structures work.

    Does the example work for you/anyone?

    Bluetooth.println(JSON.stringify({t:"htt­p",url:"https://banglejs.com/reference",­xpath:"/html/body/div/h2"}));
    

    If so, then it seems to be probably a problem with my phone. I do not want to exclude that. It is the Teracube 2e with Android 11 (there are some open issues with the phone).

    I have now modified Bangle.js Gadgedbridge for my use and added Jsoup. I also added the possibility to execute multiple XPath expressions (or selectors) with one call. If I ever have some time, I'll refactor the code and create a merge request.

  • in Bangle.js
    Avatar for ingo

    Hi,
    I have a similar problem as described in post "Unable to upload or remove apps from Bangle JS 2. Invalid JSON".

    With my phone I barely can connect to the AppLoader at all. Every time I get the error "invalid json".
    The error occurs with the Bangle.js GadgetBridge app and the AppLoader in Chrome.
    I have tried everything, disconnect and reconnect Bluetooth, reload app, reboot watch, reboot phone, factory reset, ...

    Finally I found a working but very unsatisfying solution. I have to pair the watch with the phone, disconnect of course. Then I can connect to the AppLoader without any problems. After that, I have to remove the pairing, otherwise the phone will always connect to the watch automatically.

    How to further analyze the error? Is there any way to debug or view logs?

  • in Bangle.js
    Avatar for ingo

    Hi,
    I have tried the function "access the internet", but have encountered problems.
    I have tried several web pages, with each one I get a (different) SaxParseException.

    For example, the following call results in the exception:

    Bluetooth.println(JSON.stringify({t:"htt­p",url:"https://banglejs.com/reference",­xpath:"/html/body/div/h2"}));
    

    Does the call work for anyone? Is it possibly a problem with my phone?

    Using the relevant lines from the BanglejsGadgetBridge project, I was able to recreate the error in a small sample project of my own.

    InputSource inputXML = new InputSource(new StringReader(response));
    XPath xPath = XPathFactory.newInstance().newXPath();
    response = xPath.evaluate(xmlPath, inputXML);
    

    Simple HTML/XML structures work, but complex web pages do not. I think the parser can't handle the embedded JavaScript. But I am not sure.

    I searched for other solutions and tried Jsoup. For me it worked very well.

    Document doc = Jsoup.parse(response);
    response = doc.select(xmlPath).html();
    

    A big disadvantage is that XPath cannot be used, but selector.

    The question is, am I alone with this problem? Can someone help me to get the default implementation to work? Is an implementation with Jsoup possible, or is there something against it?

Actions