Ah I see, was some how expecting to have to compile the code to binary
before launching dudac to host it.  Did not think dudac would do it all for
me - very useful!

So in the end I did this:

./dudac -f -w /home/pi/duda-examples/001_hello_world

and can happily see Hello World in my web browser via
http://192.168.1.39:2001/hello/

Cheers!
Paul - noobie hat definitely still in situation


On 18 September 2012 21:30, Eduardo Silva <[email protected]> wrote:

> On Tue, Sep 18, 2012 at 2:28 PM, Paul Read <[email protected]>
> wrote:
> > How do I compile the 001_helloworld?
>
> check the step #3 from the previous email,
>
> best,
>
> > Paul
> >
> > On 18 September 2012 17:47, Paul Read <[email protected]> wrote:
> >>
> >> Brilliant! Hope to try it out in next couple of days
> >>
> >> Paul
> >>
> >>
> >> On 18 September 2012 06:20, Eduardo Silva <[email protected]> wrote:
> >>>
> >>> As promised, here is the info that you need to start playing with Duda:
> >>>
> >>> 1) Clone DudaC (Duda Client Manager):
> >>>
> >>>     # git clone git://git.monkey-project.com/dudac
> >>>
> >>> 2) Clone Duda Examples
> >>>
> >>>    # git clone git://git.monkey-project.com/duda-examples
> >>>
> >>> 3) Go into DudaC directory and start the Hello World example:
> >>>
> >>>    # cd duda
> >>>    # ./dudac -g
> >>>    # ./dudac -f -w /path/to/duda-examples/001_hello_world
> >>>
> >>> 4) Now open your browser at: http://localhost:2001/hello/
> >>>
> >>> Comments:
> >>> ------------------
> >>> - When you run 'dudac -g', it will download Monkey and Duda sources
> >>> from their respective GIT repositories and set the development
> >>> environment for you. You only need to run that command once unless you
> >>> want to update your local copies if some patches were applied to the
> >>> master repositories
> >>> - The '-f' flag means 'fast-run', so it will not try to build Monkey
> >>> again for the web service, instead it will just perform the setup
> >>> - The '-w' flag specifies where the web service sources are located,
> >>> it will check the code, compile, configure the web server and launch
> >>> the web service.
> >>>
> >>> The source code of hello world looks like this:
> >>>
> >>>   #include "webservice.h"
> >>>
> >>>   DUDA_REGISTER("Duda I/O Examples", "Hello World");
> >>>
> >>>   void cb_hello(duda_request_t *dr)
> >>>   {
> >>>       response->http_status(dr, 200);
> >>>       response->printf(dr, "Hello World!");
> >>>       response->end(dr, NULL);
> >>>   }
> >>>
> >>>   int duda_main()
> >>>   {
> >>>       map->static_add("/", "cb_hello");
> >>>       return 0;
> >>>   }
> >>>
> >>> I am still working in some formal documentation, but you can see a
> >>> draft of the API available here:
> >>>
> >>>      http://duda.io/api/response.html
> >>>
> >>> Feel free to write to this mailing list with your questions,
> >>>
> >>> cheers,
> >>>
> >>> On Fri, Sep 14, 2012 at 2:41 PM, Eduardo Silva <[email protected]>
> wrote:
> >>> > Hi Paul,
> >>> >
> >>> > On Fri, Sep 14, 2012 at 2:09 PM, Paul Read <[email protected]>
> >>> > wrote:
> >>> >> Hi
> >>> >>
> >>> >> Brand new here so apologies for some daft questions.  Firstly very
> >>> >> impressed
> >>> >> how quick it was to get Monkey up and running on my Raspberry Pi :-)
> >>> >>
> >>> >
> >>> > we are glad you like it :)
> >>> >
> >>> >> I want to be able to control the GPIO of the Pi via a webserver.  I
> am
> >>> >> using
> >>> >> WiringPi (https://projects.drogon.net/raspberry-pi/wiringpi/) to
> >>> >> control the
> >>> >> GPIO which also works a treat.  Now I want to join Monkey and
> WiringPi
> >>> >> together.  So I can send a GET command to the RPi which then changes
> >>> >> the
> >>> >> GPIO (at this stage I don't need the RPi to do any other HTTP
> stuff).
> >>> >>
> >>> >> Very happy at writing C/C++ but am brand new to:
> >>> >>
> >>> >> * Linux
> >>> >> * RaspberryPi
> >>> >> * gcc/cc
> >>> >> * Monkey-Project
> >>> >>
> >>> >> So my question is, how best should I do this?  Potential options I
> >>> >> believe
> >>> >> are:
> >>> >>
> >>> >> 1.  Compile my WiringPi code into Monkey-Project somewhere somehow
> >>> >> 2.  Create my WiringPi code as a CGI exe and make Monkey call it
> >>> >> somehow
> >>> >> 3.  Create my WiringPi code as a FastCGI exe and make Monkey call it
> >>> >> somehow
> >>> >> 4.  Plugins?
> >>> >> 5.  Another undiscovered way...
> >>> >>
> >>> >
> >>> > I understand perfectly your requirements. The answer to your main
> >>> > question is "Duda".
> >>> >
> >>> > Duda[0] is a C framework which aims to expose a friendly C API to
> >>> > create web services on top of Monkey. So what you really need is to
> >>> > map specific URL address as internal commands, so your C web service
> >>> > links to the WiringPi library and you use it from there.
> >>> >
> >>> > Duda is under (heavy) development and i am almost ready to do the
> >>> > first release. Also i am planning to write some basic How To's for
> >>> > this weekend so you could start right away with your implementation,
> >>> > give me a 2-3 days to have something and then you send me some
> >>> > feedback, sounds a good deal ? :)
> >>> >
> >>> > [0] http://duda.io
> >>> >
> >>> > best,
> >>> >
> >>> >
> >>> >>
> >>> >> Again apologies if daft questions
> >>> >> Thanks
> >>> >> --
> >>> >> Paul
> >>> >>
> >>> >> http://www.readiescards.co.uk
> >>> >>
> >>> >>
> >>> >> _______________________________________________
> >>> >> Monkey mailing list
> >>> >> [email protected]
> >>> >> http://lists.monkey-project.com/listinfo/monkey
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Eduardo Silva
> >>> > http://edsiper.linuxchile.cl
> >>> > http://www.monkey-project.com
> >>>
> >>>
> >>>
> >>> --
> >>> Eduardo Silva
> >>> http://edsiper.linuxchile.cl
> >>> http://www.monkey-project.com
> >>
> >>
> >>
> >>
> >> --
> >> Paul
> >>
> >> http://www.readiescards.co.uk
> >>
> >
> >
> >
> > --
> > Paul
> >
> > http://www.readiescards.co.uk
> >
> >
> > _______________________________________________
> > Monkey mailing list
> > [email protected]
> > http://lists.monkey-project.com/listinfo/monkey
> >
>
>
>
> --
> Eduardo Silva
> http://edsiper.linuxchile.cl
> http://www.monkey-project.com
>



-- 
Paul

http://www.readiescards.co.uk
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to