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

Question: cordovarduino vs. cordova-plugin-serial #59

Open
tkem opened this issue Jun 18, 2016 · 13 comments
Open

Question: cordovarduino vs. cordova-plugin-serial #59

tkem opened this issue Jun 18, 2016 · 13 comments

Comments

@tkem
Copy link
Contributor

tkem commented Jun 18, 2016

First of all, thanks for this great plugin! Will post to #15 as soon as there's something to see ;-)

Looking for a USB/serial plugin for Android, I found both this [https://www.npmjs.com/package/cordovarduino] and cordova-plugin-serial [https://www.npmjs.com/package/cordova-plugin-serial], which seem to be very similar, except for version numbers and maintainers. So far, I've been using cordova-plugin-serial with my Ionic 2 app, but the link to its GitHub repo seems broken.

So, you could please shed some light on this?

@xseignard
Copy link
Owner

Hello,

The real one is https://www.npmjs.com/package/cordovarduino, the other one was a fork

I hope to see your project soon!

Regards

@tkem
Copy link
Contributor Author

tkem commented Jun 18, 2016

Thanks for the fast response! Will convert to cordovarduino then, though I had some problems with the Ionic 2 CLI installing the plugin (haven't looked into this any further, will re-investigate if that's an Ionic or user issue). On a personal note, I also prefer the name cordova-plugin-serial, since it sounds more like other Cordova plugins.

@xseignard
Copy link
Owner

I close this issue, feel free to reopen it if needed.

@tkem
Copy link
Contributor Author

tkem commented Dec 8, 2016

May I kindly suggest that you reconsider publishing this as cordova-plugin-serial? The current situation, well, just sucks ;-)

Especially annoying is that cordovarduino somehow resolves to fr.drangies.cordova.serial, and gets saved as such in config.xml:

 <plugin name="fr.drangies.cordova.serial" spec="~0.0.7"/>

but

$ cordova plugin add fr.drangies.cordova.serial
Error: Registry returned 404 for GET on https://registry.npmjs.org/fr.drangies.cordova.serial

So it's not possible to build a project from scratch using the saved plugin information in config.xml. I use a number of other plugins, and none of them gives me these headaches... So please, please, please, try to clean up this mess!

@xseignard
Copy link
Owner

PR welcome ;)

@xseignard xseignard reopened this Dec 9, 2016
@xseignard
Copy link
Owner

And as stated in the readme, this plugin is installed by cordova plugin add cordovarduino.

And be sure with this negative attitude I won't do a damn thing about this issue.

@xseignard
Copy link
Owner

Also, I cannot publish it as cordova-serial-plugin since I don't have the ownership.

The "mess" (a working plugin, actually) ain't mine.

@tkem
Copy link
Contributor Author

tkem commented Dec 9, 2016

Sorry if this came across the wrong way, no offense meant! Let me assure you that I'm very thankful that this project even exists! However, the issue here (which took me quite some time to figure out, so please forgive me if I sounded too rude - didn't mean to) is simply this:

Running

cordova plugin add cordovarduino --save

puts the follwing in my config.xml:

<plugin name="fr.drangies.cordova.serial" spec="~0.0.7" />

Now, when I do a fresh checkout and run

cordova platform add android

all plugins saved to config.xml are downloaded and installed automatically - except cordovarduino, which gives me

Discovered plugin "fr.drangies.cordova.serial" in config.xml. Adding it to the project
Fetching plugin "fr.drangies.cordova.serial@~0.0.7" via npm
Failed to restore plugin "fr.drangies.cordova.serial" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin fr.drangies.cordova.serial@~0.0.7 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/fr.drangies.cordova.serial

since it's obviously not registered with its ID.

To add insult to injury, cordova doesn't stop on the error, but continues fetching the other plugins, so the error message quickly scrolls out of view (sure not your fault, and probably warrants an issue with cordova itself).

However, using a plugin ID different from the npm package name does seem to trigger some unexpected behavior, at least when saving/restoring plugin information to/from config.xml, and also seems to be uncommon with other plugins. So may I kindly suggest you consider using the package name for the plugin ID, too, if this doesn't introduce any compatibility issues.

@xseignard
Copy link
Owner

Ok, I see the problem here, and indeed, it needs to be fixed!

The best I can do for now is change the id in the config.xml to cordovarduino.

I agree cordova-serial-plugin would be a better fit, but for that it would require that @randynwalsh give me the ownership of it on https://npmjs.org

Sorry for being harsh, I woke up grumpy!

Regards

@tkem
Copy link
Contributor Author

tkem commented Dec 9, 2016

Great, I guess changing the id will do for now!
And no worries, I know that feeling ;-)

@tkem
Copy link
Contributor Author

tkem commented Jan 17, 2017

Maybe cordova-plugin-usb-serial would be an alternative (similar to cordova-plugin-bluetooth-serial)?

@ccoenen
Copy link
Contributor

ccoenen commented Mar 28, 2018

@xseignard could you look into changing the id in plugin.xml and package.json?

id="fr.drangies.cordova.serial"
version="0.0.7">

and

"id": "fr.drangies.cordova.serial",

adding this plugin will alway change the project's `package.json´, adding this line:

"fr.drangies.cordova.serial": "~0.0.7",

and this breaks subsequent npm install. I believe changing those two places would fix the issue.

@qpwr
Copy link

qpwr commented Oct 7, 2019

guess what, @tkem, I stumbled upon the same issue. What a coincidence! :-D

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

4 participants