Git Product home page Git Product logo

Comments (25)

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

I think have more questions now (sorry!)

  1. Is there a public list of planned node modules I can see?
  2. With PR #7 would we be able to run npm install on c++ modules?
  3. 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.

ffissore avatar ffissore commented on June 11, 2024
  1. No, as soon as some users ask for some, we try to plan its release
  2. You should be able. However, a compiler is not enough: libraries sources are needed as well
  3. 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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

Do i have to recompile the whole thing every time I want to test out my makefile?

from openwrt-packages-yun.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

Yes, it is. Can you push your work on your fork so that we can look at it?

from openwrt-packages-yun.

tslater avatar tslater commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

Have you had a chance to look at it?

from openwrt-packages-yun.

ffissore avatar ffissore commented on June 11, 2024

I'm looking at it right now

from openwrt-packages-yun.

ffissore avatar ffissore commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

tslater avatar tslater commented on June 11, 2024

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.

ffissore avatar ffissore commented on June 11, 2024

What errors do you get? Can you paste them?

from openwrt-packages-yun.

tslater avatar tslater commented on June 11, 2024

Right here: agnat/node_mdns#87

from openwrt-packages-yun.

nkint avatar nkint commented on June 11, 2024

any news on that?

from openwrt-packages-yun.

ffissore avatar ffissore commented on June 11, 2024

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)

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.