4ndy
4ndy

Reputation: 610

Embedded Devices - Javascript Debugging

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?

Upvotes: 2

Views: 422

Answers (1)

Euan Smith
Euan Smith

Reputation: 2192

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.

Upvotes: 1

Related Questions