Comments (25)
It's currently not possible to compile things on the Yun. However, this PR #7 brings in gcc as an installable package.
I'll put mdns on the list of node modules. Of course, I would love to see a PR from you ;)
from openwrt-packages-yun.
I think have more questions now (sorry!)
- Is there a public list of planned node modules I can see?
- With PR #7 would we be able to run npm install on c++ modules?
- How can I learn how to add the node_mdns module myself? I've compiled a limited amount of c++ code before but I'm up to a challenge. Do you compile on linux with special settings?
from openwrt-packages-yun.
- No, as soon as some users ask for some, we try to plan its release
- You should be able. However, a compiler is not enough: libraries sources are needed as well
- You can find extensive instructions on https://github.com/arduino/openwrt-yun. You can start with an already available module and adapt it. No c++ knowledge should be needed.
from openwrt-packages-yun.
Ok. I'm doing my best here. I want to try this!
So far I have followed the instructions on https://github.com/arduino/openwrt-yun
This means I have installed a Wheezy virtualbox and run all the commands in order to create the image.
I have also forked the https://github.com/arduino/openwrt-packages-yun repo.
Now I should edit file "feeds.conf.default" to point to my fork and then create a new dir in my repo (e.x. /arduino/node-mdns) with a makefile based after an existing module. But how do I compile for the Yun? Mdns has cpp source files but I don't know how to create the package source.
Thanks for the help. Sorry, I'm still spinning.
from openwrt-packages-yun.
Way to go!
You don't have to create it, mdns maintainer has done that for you. If you type npm show mdns
it will print a json that, at the bottom, has a url that heads to the source code.
from openwrt-packages-yun.
Ok maybe this is why I'm so confused. Do I not need to recompile it specifically for the Yun? I thought that was the whole point of creating a package for openwrt-yun was that the architectures were different and I needed to recompile...What I was thinking was that gcc isn't installed I was supposed to precompile on wheezy and upload a package somewhere. It sounds like that isn't the case? The source code has .cpp files that need to be compiled. When I make the makefile for the package does that just setup things and it actually compiles on the Yun? Or am I missing something?
from openwrt-packages-yun.
You cross compile, you don't compile on the yun, you compile for the yun. The source package (I mean the tar.gz with the source code) is already available on npm and it has to be specified in openwrt Makefile (see this for example). When you compile that package (together with everything else), a .ipk file will created in folder bin/ar71xx/packages (IIRC) and THAT will be your node-nmdns module
from openwrt-packages-yun.
So the .ipk is what the yun downloads and runs when the opkg install
command is invoked? How do I go about actually compiling that and where does it end up? I understand I need to edit that makefile for the module I want but I don't understand when/how it is used.
from openwrt-packages-yun.
Good question: once you'll have ADDED a new Makefile in a folder you'll probably name node-mdns
and the feed of your fork will be downloaded, you'll asked what to do with that package. You'll be prompted if you want it built in (y), as a module (m) or you don't want it (n). Choose m
.
from openwrt-packages-yun.
What do you mean by " feed of your fork will be downloaded, you'll asked what to do with that package." Would that happen by adding the makefile and then calling opkg install node-mdns
on my wheezy box with my cross compiled yun? Or do I have to recompile the whole thing with my replaced file?
from openwrt-packages-yun.
That's a case when doing it's simpler than explaining. Go on with your fork, add the Makefile, build the image following the instructions at https://github.com/arduino/openwrt-yun and you'll see what I mean
from openwrt-packages-yun.
Do i have to recompile the whole thing every time I want to test out my makefile?
from openwrt-packages-yun.
If you don't clean up (as build.sh does at the beginning) make
will be smart enough to understand that something has already been compiled
from openwrt-packages-yun.
OK! I'm on my way! I have run into some roadblocks that weren't too bad but now I'm stuck on this one:
ln -fs libdns_sd.so.1 /home/tyler/yun/openwrt-yun/build_dir/target-mips_r2_uClibc-0.9.33.2/node-mdns-2.2.0/ipkg-install/libdns_sd.so
npm install -g /home/tyler/yun/openwrt-yun/build_dir/target-mips_r2_uClibc-0.9.33.2/node-mdns-2.2.0
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/mdns'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/mdns']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/mdns',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/mdns',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
It looks like it is trying to install in my system root instead of ~/openwrt-yun/build_dir/target-mips_r2_uClibc-0.9.33.2/node-mdns-2.2.0/
. Is the PREFIX supposed to fix that? I'm a little lost as to how all these paths work.
from openwrt-packages-yun.
Yes, it is. Can you push your work on your fork so that we can look at it?
from openwrt-packages-yun.
Yessir. Thanks again! I wish I was better at contributing. If I figure it out on this one I can possible help with other modules.
https://github.com/tslater/openwrt-packages-yun/blob/master/arduino/node-mdns/Makefile
from openwrt-packages-yun.
Have you had a chance to look at it?
from openwrt-packages-yun.
I'm looking at it right now
from openwrt-packages-yun.
I had to fix mixed tabs and spaces (be careful, these Makefiles use tabs).
Remove this part.
The error you get then is
In file included from ../src/dns_sd.cpp:1:0:
../src/mdns.hpp:31:20: fatal error: dns_sd.h: No such file or directory
That means node-mdns requires an include file that is missing. This is provided by package mdnsresponder. Add the following lines (empty lines included)
PKG_BUILD_DEPENDS:=mdnsresponder
HOST_BUILD_DEPENDS:=mdnsresponder
Add them BEFORE include $(INCLUDE_DIR)/package.mk
However, node-mdns also requires a system library available at runtime: libdns_sd.so
. Modify line
DEPENDS:=+node
to
DEPENDS:=+node +mdns-utils
It should compile. Test it and report back.
from openwrt-packages-yun.
It compiled! I've been trying to work through other errors I've had since compiling. It looks like the errors are related to compiling. There is an internal module that give me a "file not found" error. The file is definitely there but apparently, as I've learned here: agnat/node_mdns#87 those errors are often a result of compilation issues. I'm wondering if It's because I need to include parts of this makefile: https://github.com/agnat/node_mdns/blob/c67c793700ccc3fced0840a50526d4406d4bd052/Makefile
in the makefile I've created here:
https://github.com/tslater/openwrt-packages-yun/blob/master/arduino/node-mdns/Makefile
Is that the case?
Or is there just an issue here?:
https://github.com/agnat/node_mdns/blob/c67c793700ccc3fced0840a50526d4406d4bd052/wscript
(this is only for node versions < 0.8.0 right? It shouldn't matter?)
from openwrt-packages-yun.
Or it now seems more likely (from the mdns readme) that it has to do this this:
"On Linux and other systems using the avahi daemon the avahi dns_sd compat library and its header files are required. On debianesque systems the package name is libavahi-compat-libdnssd-dev. On other platforms Apples mDNSResponder is recommended. Care should be taken not to install more than one mDNS stack on a system."
and this:
https://github.com/agnat/node_mdns/blob/c67c793700ccc3fced0840a50526d4406d4bd052/binding.gyp
It seems like we have both...would it be easiest to compile as mac and use mDNSResponder in /usr/bin?
from openwrt-packages-yun.
What errors do you get? Can you paste them?
from openwrt-packages-yun.
Right here: agnat/node_mdns#87
from openwrt-packages-yun.
any news on that?
from openwrt-packages-yun.
It seems like client side mdns is hard to get to work on the yun at the moment.
If you take a look at arduino/openwrt-yun#7 there are tools but no libs for using mdns.
Things may change in the future: latest OpenWrt (14.07, RC3 at the time of writing) mentions
mdns: new lightweight mdns daemon (work in progress)
However, we won't have a yun version until we as a community start working on porting the current version, which is based on OpenWrt 12.09
from openwrt-packages-yun.
Related Issues (20)
- [node-bleno / bluez] GATT server HOT 3
- socket.io and socket.io-client deprecated HOT 1
- Question about packages-yun HOT 2
- Using ImageMagick's "animate" tool HOT 5
- jamvm HOT 2
- general opkg socket.io update HOT 2
- yun-gcc tries to install files already provided by libstdcpp HOT 3
- Yun-gcc package is missing many headers HOT 5
- Sqlite3 with node.js HOT 7
- Subject: Arduino Yun and node.js, a good read HOT 1
- reboot should also reset-mcu HOT 1
- python-netifaces HOT 6
- please update root-zone trust-anchors in root.key file
- opkg distribute package failing HOT 4
- Collectd-python is missing
- "node" script should consider swap
- Imagemagick missing multiple binaries HOT 3
- reset-mcu in rc.local HOT 1
- run-avrdude may fail if /tmp/efuse is not created
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openwrt-packages-yun.