node-ssdp API for Sonos is missing - javascript

I'm trying to figure out how to interact with the Sonos One using JavaScript; Sonos has developer guides and downloads for JavaScript but none of them work, because the node-ssdp project has been archived and is no longer available. Does anyone have a reference or a contact at Sonos through which we can access the devices directly? The cloud API works but is a lot heavier than talking to the devices directly over a LAN.

Okay, this ended up being a dumb question. Sonos apparently forked node-ssdp and hosted their own for a while, and the standard npm node-ssdp library works fine for this purpose.
Remove the node-ssdp dependency from the package.json, then:
npm i node-ssdp
Not everything works, because the Sonos samples in JS were written for very old versions of Node and have not been updated, but the base packages are fine.

Related

How to fix VS Code unable to create a strapi app?

I'm Having an issue that ruins my entire development plans, And I don't think I'm even the problem!
There is an headless CMS program (open source) called Strapi, If you know the program then good, If not, Your more than welcome to try and tell me if you can help me with this problem.
I'm having trouble creating a Strapi app in VSCode.
The error that I'm receiving is:
You are running Node.js 18.4.0
Strapi requires Node.js >=14.19.1 <=16.x.x
Please make sure to use the right version of Node.
But, The fault isn't on me, I have 16.17.0 version of node installed, and without a trace of the 18.4 version specified on the error code.
I tried uninstalling node, Changing the dependencies in the launch.json file, Nothing worked!
So I Found the solution, the problem was with the version, the recommended 16.17.0 version of node not working with strapi, the 16.15.0 works actually.

Difference between VSCode Live Server and Node Live Server

I'm getting started with JS so I've reached the point where I have to install a live server with npm. VSCode has a popular extension that many know of called Live Server(Ritwick Dey), my question is what is the difference between using the extension and installing the package with node? Are there any standout features that could aid in my development or are they pretty much the same? Thanks
Both will work in a similar way if you do not plan to use custom configurations and work alone on a single computer.
If you are working in a large team and want to have the same setup available for everyone, you should install the node module for the project and go with the 'Usage from node' section of the documentation.
Both options have great documentation on how to customize them. They differ in naming but for the most part both projects offer similar options.
For live-server, the npm package, your can use the online documentation to see the available ones.
https://www.npmjs.com/package/live-server
For the VsCode extension, you have a list of available configuration here.
https://github.com/ritwickdey/vscode-live-server/blob/HEAD/docs/settings.md
Before selecting one for you project, you should look at the available options and see if there is a feature that might be helpful for your project.

How napchart.com is constructed

I want to build a site similar to this one.
So I downloaded the source code from https://github.com/larskarbo/napchart on my Windows 10 machine, but I don't know how to execute the thing and see it running in a page so I can play with the code and see how it is working.
I have node.js installed but I am not sure of how to use it, so detailed instructions are welcomed
Also, I tried saving the code from the site directly by clicking Save As but it didn't work though. Why is that happening?
Considering napchart has been pushed to the npm registry, you shouldn't need to interact with its source code directly.
As per your second question, I don't advise to download any of it manually. Running npm install napchart --save in your project directory should get you going.
That being said, the author also published the source of https://napchart.com/app, which can help you bootstrap your project.

autobahn.js file is not accessible from s3

For some time I am using autobahn.js and autobahn.min.js files in my project linked directly from:
https://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.js and
https://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.min.js
as suggested on http://autobahn.ws/ website.
Today I found out the two above files are no longer accessible via these links. Only thing I can see is 403 error with message: Access Denied.
I can not find any mirrors anywhere. I tried to build them using this instruction: http://autobahn.ws/js/building.html. No such luck. Where can I find autobahn.js files so I can download them in case of situation like this happen in the future?
Self answer. Unfortunately author decided to remove all the files from Amazon S3 as described: https://groups.google.com/forum/#!topic/autobahnws/aHxWgImJvCY
Hi,
we (Crossbar.io GmbH) have not only provided massive development
funding of AutobahnJS, but also free hosting of AutobahnJS for
development purposes (download it and host it yourself).
We asked people NOT to hot link to this bucket MULTIPLE times, as we
have to pay for the traffic obviously.
Now, it seems, people don't get that.
Our traffic costs have persistently increased to a surprising level. I
just wanted to delete the log folder alone in that bucket - and I have
a hard time, the log files number in the 100k's!
There seem to be a number of highly frequented sites hot linking to
our bucket.
Now, instead of injecting some nice JavaScript to completely take over
all those sites (which is trivial and would take me half an hour to do!), we have decided to remove the whole bucket.
Dozens of sites will break. Not our problem.
Cheers, /Tobias
Newer source files can be still found on github (the one that implements wamp v2). Last version that implements wamp v1 (v.0.8.2 of autobahn-js) however can be found in this repo:
https://github.com/sergeyvolkov/autobahn-old
It can be hot swapped if you were using links from my question. Good source of other older versions is to digg through releases on GitHub page:
https://github.com/crossbario/autobahn-js/releases
Try this link https://github.com/crossbario/autobahn-js-built . They have the files
There's a README:
https://github.com/crossbario/autobahn-js-built/blob/master/README.md
Here's a summary:
Install bower:
npm install -g bower
Install autobahn in your web dir:
bower install autobahn
Change your links to point to:
<script src="/bower_components/autobahnjs/autobahn.min.js"></script>
I'm not sure why you replied to another comment RE wamp v1 / v2 as the URLs you posted are retrieving the latest.

[React-Native]RN Version Upgrade Wiped Out Android Plugin Projects

I was trying to upgrade my RN from 0.19 to 0.27 using the commands from the doc,
i.e.
npm install --save react-native#0.27
react-native upgrade (I chose the overwrite option when asked to update the latest RN files)
The npm install step worked fine but the upgrade step wiped out all my code in android plugin folders and any changes made to MainActivity.java. My environment is : MacOS, Genymotion, Android development
Thanks!
You've missed that react-native upgrade asked you if you want to overwrite your files. react-native upgrade replaces your files with newer version if it's different than the default one. It does not merge your changes. Also jump from 0.19 to 0.27 is a big one so probably there was a lot of changes.
Yes, react-native upgrade will wipe everything out. There's a command line option now (react-native link) that will put most of it back in, but not everything.
If you choose not to overwrite the files you are risking not including something very important and it may break the upgrade.
I don't know of a good way around this. My process is to use a good ide that shows me exactly what has changed between upgrades. Then I go though each change and see if I'm missing something. The java code and android studio files tend to be quite easy. But the xCode stuff is not, the pbxproj file is particularly awkward. You mostly need to reconstruct it by using Xcode. So... every time you do something to the xCode project, make a note of it! Yes this is a terrible solution, but I don't know what else to do.
I've ended up making detailed notes about everything I do during an upgrade. And I upgrade recently because its easy to forget.

Categories

Resources