Giter VIP home page Giter VIP logo

juart's Introduction

billhsu

juart's People

Contributors

adilek avatar billhsu avatar bryant1410 avatar gmkarl avatar gregwar avatar rwmcintosh 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

juart's Issues

Invalid Plugin ?

I have add npjUART.so to /usr/lib/mozilla/plugins/

The file : /home/USER/.mozilla/firefox/5b6bl9nk.default/pluginreg.dat

Generated File. Do not edit.

[HEADER]
Version:0.17:$
Arch:x86-gcc3:$

[PLUGINS]

[INVALID]
/usr/lib/mozilla/plugins/npjUART.so:$
1432420681000:$

I don't find solution :(

I'm use Debian i386 witch Iceweasel, but it same witch Firefox.

如何将添加npjUART.dll中

您好,我想问下,如何将npjUART.dll添加到chrome中,我本地安装chrome版本是: 76.0.3809.132(正式版本) (64 位),在里面没有找到Plugins目录

Printing data from port to screen

Could really use some quick help on how to get data from a scale to print to the screen. I have a button who's onclick function is "pluginLoaded()". Here's the functions, clearly recv is incorrect I just don't know how to fix it:

function recv(bytes, size)
{
  return(bytes);
}

function pluginLoaded() 
{
  ser = plugin().Serial;// Get a Serial object
  ser.open("COM2");// Open a port
  ser.set_option(2400,0,8,0,0);// Set port options 
  ser.recv_callback(recv); // Callback function for recieve data
}

Windows 8 (AMD64) Chrome

Does this work under Chrome with Win8 x64? I tried putting npjUART.dll in the Chrome application directory, the Chrome plugins directory, windows\system32 and windows\syswow, and with each I ran regsvr32, and I still got "Uncaught ReferenceError: plugin is not defined" when I put "var ser = plugin().Serial;" in a script.

Juart Crash

Hi!
I'm having problems with juart. It crashes time to time. I have installed it on firefox 40 and 43, and sometime it crashes. When I see it at the crash analysis, it says Unhandled c++ exception.

Do you have any idea, or any improved version?

Thanks
Elis

how to send value>0x7f?

Hi~
when i try to send 0x80, ser.send(0x80) ,chrome said "Invalid argument conversion from double to char at index 1".
i'm poor at js, can you tell me how to pass "byte"?

Can't reconnect to device

System: Ubuntu 16.04 LTS
Browser: Firefox
plugin version: downloaded from bin/Linux_x86_64/npjUART.so at commit 979c040
Test process: Have an Arduino board constantly sending data to serial port connected to computer. With the following code, the data will be displayed to the console. However, if the device is disconnected and reconnected, calling ser.is_open() will return true, but no message can be received anymore

<html>
    <head>
        <title>test page for object fbcontrol</title>
    </head>
    <script type="text/javascript">
        var ser;
        function plugin0()
        {
            return document.getElementById('plugin0');
        }
        plugin = plugin0;
        
        function recv(bytes, size)
        {
            console.log(bytes);
        }
        
        function pluginLoaded() 
        {
            ser = plugin().Serial;// Get a Serial object
			ser.open("/dev/ttyACM0");// Open a port
			ser.set_option(115200,0,8,0,0);// Set port options 
			ser.recv_callback(recv); // Callback function for recieve data
        }

        setInterval(function() {
            if(!plugin().Serial.is_open()){
                console.log("reconnecting");
                pluginLoaded();
            }
        }, 1000);
    </script>
    <body onload="load()">
        <object id="plugin0" type="application/x-juart" width="0" height="0" >
            <param name="onload" value="pluginLoaded"  />
        </object><br />
        <h1>jUART Serial Port Echo Test</h1><br/>
        This test will echo the data you sent through serial port.
    </body>
</html>

jUART may become permanently unable to send if closed during an incomplete send

The checks for calling send_start all check send_msg.empty(), but send_msg is only emptied when a send is successfully completed. Hence, if the io loop ends with send_msg not empty, a new send_start will never be initiated.

A solution might be to clear send_msg in the else clause of SerialAPI::send_complete().

I've encountered what I suspect is this issue while testing my app (send_msg full, no send_start running, hence new calls to send() do nothing). However, I haven't come up with a way to isolate and test this issue yet.

Plugin not working with chrome 64 bit

My version of chrome auto updated to 64 bit version of chrome and your plugin stop working. I rolled back to 32 bit version of chrome and it was working again. Is there any way in which to get this plugin to work with 64 bit version of chrome?

ReferenceError: plugin is not defined

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

Documentation & Development

Hello,

i was asking if there are more feature coming on? are this project still underdevelopment? also about the Documentation it will be so useful.

More features like force open and close of ports, list available ports, error reporting if connection failed. safe closing of port in order not to face windows problems. thanks

sendmulti() dangerously shares resources with send()

Inspecting the send code paths, I see that sendmulti() and send() share the same message buffer(send_msg), but both treat the buffer as if they are solely in control of it.

send_multi_complete() empties send_msg when it is done. Meanwhile, do_send() checks if send_msg is empty to determine if its asynchronous loop is running! Similarly, it queues its individual bytes on send_msg which will be emptied if a sendmulti() is also running.

It looks like sendmulti() may also have a bug where data is dropped if it is queued up but not ready to be sent yet. send_multi_complete() clears send_msg when done, without calling send_multi_start() again, and do_multi_send() does not call send_multi_start() if there is already data being sent in send_msg; it simply adds the new data to the end.

A good solution to these issues might be to merge shared behavior between the two sets of functions into one set of functions. Maybe a different way of keeping track of data in transit, such as a second queue or a flag.

Can´t run plugin on Windows

I can´t make the plugin is available on firefox, I follow your instructios "Take FireFox for example: Copy /bin/Windows/npjUART.dll to C:\Program Files (x86)\Mozilla Firefox\plugins" and it doesnt work´.

Even I install the plugin using Windows registry with no succes:

HKLM/Software/MozillaPlugins/plugin-identifier
Descripton: REG_SZ "Description of the Plugin"
Path: REG_SZ "C:..Path to the plugin.dll"
ProductName: REG_SZ "The Plugin Name"
Vendor: REG_SZ "The Plugin Author/Vendor"
Version: REG_SZ "0.5.whatever plugin version string"
HKLM/Software/MozillaPlugins/plugin-identifier/MimeTypes
Add a sub-key for each MIME type the plugin supports, with no values

I use Windows x64 and Firefox 35.0. Hope yo can help!

troubleshoot plugin install

Hi,

I have successfully installed and worked with the plugin earlier but in one of the machines which is Windows 7 SP1 and ie 11m the plugin is not available after successful registration of dll.

Any hints on how to troubleshoot this.

I have copied the dll under syswow64 and registered it using regserv32 form the same folder.

The plugin is not available on any of the browsers (chrome and ie).

On further investigation I have found that the plugin is available for admin users but is not available to standard users. Any idea on how I can resolve this.

Regards
Maaz

JsError: plugin().Serial is not defined

My environment is WIN7 64bit.
My browser is Firefox.
I have coped the /bin/Windows/npjUART.dll into my browser's plugin directory.
But i can't get plugin().Serial Object,
Did I need to take any other steps?
Thank you for answer!

Problem on installing jUART plugin in Linux-Ubuntu

Hi,
I have to install a plugin (jUART-plugin) in both WINDOWS & LINUX. I got installed successfully in windows using instruction as like you said in https://github.com/billhsu/jUART.

But I can't install npjUART.so (jUART Plugin) in linux ubuntu. I have tried sudo cp npjUART.so ~/.mozilla/plugins/ and pasted that file (npjUART.so file)in following location on linux. Still I didn't get that plugin firefox addon page,

$HOME/.mozilla/plugins
program_directory/plugins
/usr/lib/mozilla/plugins
/usr/lib/xulrunner/plugins

At which flavour of linux it will be worked..? Here I have tried with both Ubuntu 32 & 64 bit machine.

Is there any way to get that plugin on firefox in linux?

Thanks & Regards,
Yuvang

reading the serial data return

Hello there send the metod for the serial, but could not find a method of reading. Is there? If there is no way I could develop, could give me a help to create this method? Thank you =)

rebuild error

CMake Error at CMakeLists.txt:39 (include_platform):
Unknown CMake command "include_platform".

Adding to Chrome 57.0

Hello!

Is it possible (and how) to add this plugin to current Google Chrome (57)? Is it operable with this version of Chrome?

JUart and security

Hello,
What about the security?
I mean, accessing serial ports is not allowed by js because of the sandboxing, so I think there could be some bad uses of this fearure

getports() takes ~15 seconds

HI,
I am trying to get a list of available serial ports and I am using the function getports().
Testing the original npjUART.dll for Win, on a Windows 10 (64bit) machine, which is a all-in-one PC without any native parallel or serial port on board. I am using only USB to serial adapter to get UART functionality, which is working fine.
Here is my JS code:

function ListPorts() {
    if ( ser )  ser.close();
    console.time("plugin.serial");
    ser = plugin.Serial;// Get a Serial object
    if ( ser ) { console.log("Got serial object successfully..."); }
    else { alert("ERROR: Could not get serial object!"); return; }
    console.timeEnd("plugin.serial");
    console.time("getports");
    ports = ser.getports();
    console.timeEnd("getports");
    console.log( "Available ports: " + ports);
}

This is what I get in console:

plugin.serial: timer started
Got serial object successfully...
plugin.serial: 2.96ms
getports: timer started
getports: 14397.2ms
Available ports: COM3

As you can see, the function getports lasts ~15 seconds(!!!), which is too long, I think.
On another WIndows 7 machine the same code and same plugin works flawlessly.
What can be the root cause?
Is there any way to improve this?
Thank you.

Data Received is truncated

Hi,
I am reading data from a weighbridge. The data read is truncated.
The data received is of the form

�)8 43020 00
�)8 43020 00
�)8 43020 00

but I receive only
�)8 430
in javascript.

I have checked the port setting and I am setting them right.

Regards

How to loop to get all the data from serial, im receiving only 1 line

Hey guys, great job.

this is my issue, If I go to putty and open the serial port and fetch the info I get this.

“000315 06/22/2015 13:08
- 129.6 kg N
0.0 kg T
- 129.6 kg G”

and when i try to use the jUART , i get the info and only get the 1st 32 bytes of this

"000305 06/22/2015 12:56
"

ps: (this was an earlier capture from serial, since the 1st one is 315 and this one is 305)

my firebug returns for bytes : [48, 48, 48, 51, 50, 54, 32, 48, 54, 47, 50, 50, 47, 50, 48, 49, 53, 32, 49, 51, 58, 52, 57, 13, 10, 32, 32, 32, 32, 32, 32, 32]

and for size : 32

so seems it's only getting the 'first' line of the serial output.

any ideas how i can solve this?

Cheers.

J.

ps: my html snippet is here : http://pastebin.com/TVutka3N

jUART breaks if socket is closed due to error

I'm experiencing that if an error occurs midstream, jUART is left in a broken state where it can no longer open a socket and communicate.

I think this is because an error created by the async recv or send calls results in a premature call to SerialAPI::do_close which ends the io loop with no associated io.reset() call to reset the io loop, resulting in the next call to io.run() returning immediately, but I haven't verified this yet.

I'm testing this error using socat -v -x pty,raw,echo=0,link=ttyfake1 pty,raw,echo=0,link=ttyfake2, opening ttyfake1 with jUART, then killing the socat process to trigger a premature close.

JUART NOT WORKING

I download the repository from git hub and copy the jUART file into my system32 folder as well as a syswow64 folder. and I have no any plugins folder into Mozilla so, I create the folder

C:\Users\usename\AppData\Roaming\Mozilla\Firefox
in this location. but still, I m not getting success

space character :S

Hello friend, forgive my English. I wonder how to send a space character. Whenever you send me the plugin returns error.

Serial.open() behaves unexpectedly if re-opened when already open

If serial is already open, Serial.open(newdevice) will presently

  1. report an error when asio throws
  2. replace the "device" member of its c++ class with newdevice (this member is unused)
  3. stay connected to the old device
  4. return true

I propose it either

  1. return false if already open, and not replace "device"
    or
  2. close the old device automatically if open() is called when already open

Data Received is truncated

When sending a string of more than 512 characters the recv function only gets the first 512 characters and then stops receiving, is there any way to increase reading ability?

Keep connection open

Hello,
good work. is there a method to keep the connection to the serial port open while moving from page to page or refreshing. i mean in order not to reset the serial device each time i open a page can i keep the connection open then call it from another page?

GetPorts api is not able to display COM port in Ubuntu.

Hi,

I have Downloaded the jUART and built according to mentioned steps in readme.md. It generates npjUART.so. Copied this generated .so file to /usr/lib/.mozilla/plugins directory.

I am trying to know com ports present in the ubuntu machine by calling the getports api.

I could able to see COM port ttyUSB0 in the /dev/ directory. However no devices are displayed when i run the html file. Here is the code I am trying.


function ListPorts() {
if ( ser ) ser.close();
console.time("plugin.serial");
ser = plugin().Serial;// Get a Serial object
if ( ser ) { console.log("Got serial object successfully..."); }
else { alert("ERROR: Could not get serial object!"); return; }
console.timeEnd("plugin.serial");
console.time("getports");
ports = ser.getports();
console.timeEnd("getports");
console.log( "Available ports: " + ports);
}


Could you please tell if i am missing anything.

Thanks
Mahendra.

load() is not defined

Hello,

I copy the npjUART.so in my ~/.mozilla/plugins and I test the code in the README.

But the function load() is not defined in the body.

Could you help me to make it run ?

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.