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
Cannot install wiring-pi because of libwiringpi cloning failed #31
Comments
Can you post the content of the file |
Cannot reproduce, maybe you had issue with your internet connection |
had the same thing turned out git was not installed |
I had the same problem and now it is solved thanks to you @erikkallen 👍 |
@erikkallen Is there a solution for this on a Mac? |
I think git should be on your system, you can check this by typing git in your terminal, if it is not available you could try installing the xcode-commandline tools as described here http://railsapps.github.io/xcode-command-line-tools.html if that does not work I wouldn't know |
any news for mac? |
@IgorGanapolsky and @caiusCitiriga , this is not supposed to work on a Mac since the required hardware isn't there.. Or did i miss anything? |
@tillepille ouch, it's how I was supposing.... So, here's what I'm trying to get. I'm developing my core scripts for the raspi on a Mac, using typescript. So, the @types gets successfully installed, the package though is not. Is there a workaround where I can "mock this whole thing?" I wouldn't like to switch lib, or machine. In fact, the same code ported on the raspi, and ran npm i works like a charm (of course) |
Unfortunately I don't have a good solution for you... My workflow was developing on Mac with Atom and then pushing to a git, from wich i pull on the raspi to run and test the code. |
@tillepille Well, I appreciate your support anyways :) WorkaroundIf it can be useful to someone, I've found a workaround. It's ugly, not very practical without setting some scripts in the package, but for me, after some configuration, it turned out to be very useful. So here's the stuff that you need:
Now, the main problem for us mac folks, is that we cannot build wiringPi, but a ubuntu machine can. So the solution:
The setup step by step[1] Get the VM ready and setInstall your Ubuntu distro on Virtualbox creating a new VM.
Note: the bridged connection is the most important part. Create your VM, attach to the virtual CDRom unit the ISO of your distro and boot it up. Note: during the install, when the packages selection comes up, remember to check the SSH. Otherwise you'll have to apt-get install it. Once the installation is done, log into the machine and assign a static IP.
In the VM terminal type:
This will open up the interfaces configuration file. Here, add your network configuration.
Press Ctrl + X and save your changes.
You should reboot your network interfaces with the ifup and ifdown commands, but this is a bullet proof method, and as long as we are on a VM, the boot time should be quite faster. Be aware that I'm using ubuntu 16.04 LTS. In which the network names were slightly changed. In this case, the previously called eth0 which was the primary network adapter (AKA Ethernet), now it's called enp0s3. In my opinion? eth0 was so damn intuitive! Now on your host machine (Mac), you have to get an SSH connection to the VM, you don't want to use the Virtual Box's window every time. So, in order to do that, open your terminal and type:
where your username will be the username you use to log in the VM and the host-ip is the static ip we've set earlier. You should be prompted for the password. To do so, close the ssh session, and on your mac terminal type the following commands:
This will prompt you with a series of questions, just press ENTER to each one, till you reach something like this:
Now we'll use ssh-copy-id to copy the generated key to the VM.
Once installed, run:
Once again, the useranme you use to login and the VM address.
Type your password and that's all!
If everything went well, you should be able to login without the password. [2] Configure the VM for node develpmentSame old routine:
You should have now all the needed packages installed. Give it a check firing:
[3] Link the two machines workspacesYou will find this feature under the machine settings in VirtualBox. Pick a folder that you will use on your mac to develop your project, and share it with the VM. Login into the VM, you will find the folder at this location, assuming that is called Code
Once you've cd into it, init your npm project in a new folder. (from mac, or VM, it doesn't matter)
The structure that is use is to separate the src folder and the dist folder. And put all my core code inside the src Init your tsconfig.json file:
Tweak your tsconfig file as you like. [4] Start the watcherThe watcher can be started with this command:
Note: the watcher must be launched from the VM, in the same folder shared with the mac. Because you'll code on Mac. So in our case will be: /media/sf_Code/main [4] The deployNow suppose that we have a index.ts file in the src folder, this would be enough to have something to deploy. So here's what we will be doing:
$ rm -rf dist
$ node_modules/.bin/tsc
$ scp -r dist/ <your-raspi-username>@<your-raspi-ip>:<the-deploy-directory>
$ ssh <your-raspi-username>@<your-raspi-ip>
$ cd <the-deploy-directory>
$ sudo node index.js The in my case was: /home/maxine/core Pro tip: scripts and @typesTo make all this process less painful and more automated I've created some scripts that will handle all this for me. The only thing I need to trigger in order to deploy, is a npm script. Here's the npm package scripts:
Here's the content of the transfer-nobuild.sh:This is a version of the script that uses the last builded dist from the tsc compiler. In my case the out-tsc folder. This allows me to keep the watcher running while I develop
wiringpi-node @typesUnfortunately I've found only the @types/wiring-pi. But for what I've learned from the documentation of the library, the methods are the same. That's all! Hope it helps someone, and I apoligise for the lenght. If there's something not clear, please ask. If you can improve this somehow, feel free to do it. Here's a working repository of a robot that I've built using this solution: Go further with the scripts usageIf you're a cool guy, you do most of your work from the terminal. |
When i tried to install wiring pi using npm, it failed and shown below error
The error tells me that I have to tell the wiring-pi author. Can you help me?
The text was updated successfully, but these errors were encountered: