Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: plugin is not defined #45

Open
oshihirii opened this issue Aug 9, 2016 · 4 comments
Open

ReferenceError: plugin is not defined #45

oshihirii opened this issue Aug 9, 2016 · 4 comments

Comments

@oshihirii
Copy link

Environment:

Firefox 48 for Ubuntu

I've followed these steps in README.md:

  • Copy bin/Linux/npjUART.so to: ~/.mozilla/extensions.
  • And js file looks like:
//Get a Serial object
var ser = plugin().Serial;

// Open a port
ser.open("/dev/ttyACM0");

// Set port options
var baud = 9600;
var parity = 0;
var csize = 8;
var flow = 0;
var stop = 0;

ser.set_option(baud, parity, csize, flow, stop);

// Send a byte to serial port
char = "";

ser.send(char);

Did I need to take any other steps?

Do I have to "build it"?

When I run the HTML file, Firebug says:

ReferenceError: plugin is not defined

@billhsu
Copy link
Owner

billhsu commented Aug 9, 2016

@oshihirii can you try copying the plugin into other folders where they mentioned in this post http://askubuntu.com/questions/383960/where-is-firefoxs-plugins-directory? If still not working, you may recompile the binary on your machine.

@oshihirii
Copy link
Author

Thank you for your reply!

I thought the project might be dead!

As per the accepted answer in your link:

~/.mozilla/plugins - does not exist in Ubuntu 16.04 xenial (x86-64).

The only directories that are in ~/.mozilla/ are:

extensions
firefox

Bu I followed a user comment and saw this exists, so I put /usr/lib/mozilla/plugins/npjUART.so in there:

/usr/lib/mozilla/plugins

And I get the same error after restarting Firefox and opening the HTML page:

ReferenceError: plugin is not defined

I have never "compiled a binary".

Can you please give me exact steps (as much detail as possible appreciated, as I have zero knowledge about it so I may miss some important steps if I'm not shown how to do it exactly). Thank You!

@billhsu
Copy link
Owner

billhsu commented Aug 10, 2016

@oshihirii There's no active development on this plugin currently because NPAPI-Plugins are not supported by chrome from version 45.0.

For compilation of the plugin, please follow the steps in README.md.

    1. Install FireBreath
    2. Run python fbgen.py in firebreath-dev, please set "Plugin Name" to jUART
    3. Goto firebreath-dev/projects, delete the jUART directory
    4. Same in firebreath-dev/projects, run git clone git@github.com:billhsu/jUART.git
    5. Linux: ./prepmake.sh Mac: ./prepmac.sh
    6. Linux:cd build/ then make

@oshihirii
Copy link
Author

Thank you for the information.

Do you know anything else that does the same job?

I need to communicate from web page to local serial port.

I was using pyserial (mine is a python based web application) but that only works locally - not from a "live" website.

I looked at:

http://www.firebreath.org/display/documentation/Download

and downloaded the zip file.

How do I do Step 1 of the steps in your README.md ie "Install FireBreath"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants