2

I work on embedded devices but am not able to install any software on them (e.g. programs like gdbserver are out). I need to monitor javascript events on those browsers. For example, if we run a web app on the EWB, the device it's on might have a keyboard pop-up. I need a way to see what triggers this event.

I am thinking along the lines of perhaps embedding something into the HTML or javascript that automatically reports any events back to a workstation somewhere.(I already have logs, but they are not live and it's difficult to pinpoint what happens - even beartailing them... wish I could have something like Firebug, but since it's embedded I can't)

Has anyone seen anything along those lines?

8
  • 1
    I've been half looking into this as we may need something similar in the near future. I'd identified VorlonJS as a possible candidate to look into, although I haven't given it more that a cursory look so far. Commented May 4, 2016 at 7:07
  • That looks like what I am after! Thank you, @EuanSmith Commented May 4, 2016 at 7:12
  • I had a bit of a trial with Vorlon.JS, but it won't do what I'm after... yes, it's similar to Firebug, yes, it's going to let me troubleshoot a site, but it still requires the site to run in a sandbox or via proxy, which defeats the purpose. If the device I am working on fires a keyboard from the firmware, I need to find a way to see how that's triggered on the embedded webserver. Commented May 5, 2016 at 5:55
  • That's a shame. By 'in a sandbox or via proxy' I presume you are talking about the need to insert a script tag into an app for it to be enabled. The thing is, if you are looking for a JavaScript-only solution, i.e. nothing else installed on the embedded browser, how else would you do it? You need some agent on the target device to get the data and if you can't install any software I can't see how else you could do it. Commented May 9, 2016 at 11:57
  • Well, what I meant is, the web app will actually run in a sandbox on localhost, or you can run an existing website via proxy, but again it would be running in the localhost environment - which is nice, but it won't tell me what events actually affect the site on the embedded system (e.g. the firing of a native keyboard). Right now, this is my biggest problem: I can write the app, insert a line of script (as in Vorlon.js, for instance), but I can't find a way of monitoring what actually happens on the embedded system. Commented May 10, 2016 at 1:00

1 Answer 1

1

To get a debug connection to a web app or page running on a remote device:

  1. Install vorlon using npm
  2. Download ngrok
  3. Start the vorlon server, the server port will probably be localhost:1337 and the following steps assume this
  4. From a terminal/command prompt run ngrok with ngrok http 1337 and it should report an ip address for the other end of the tunnel, something like def01234.ngrok.io available via http and https.
  5. Instead of the local script tag which vorlon suggests, use the remote ngrok address, e.g. <script src="https://def01234.ngrok.io/vorlon.js"></script>. ngrok exposes both http and https - as this is over the public internet I would strongly recommend using a secure connection.
  6. Log onto the vorlon server on your local machine.

If the above test works you are going to want to do two more things:

  1. Get an account at ngrok (or an alternative secure tunnel service) to get a fixed address.
  2. Configure vorlon authentification according to the instructions on this page. By default it is insecure so ANYBODY with the exposed ngrok address could log onto the dashboard and mess with your embedded devices.
Sign up to request clarification or add additional context in comments.

1 Comment

There have been a couple of down-votes of this answer. That is fine of course, everybody has a right to their own view. I would, however, really appreciate it if you could explain why. So please, if you down-vote, also leave a comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.