GithubHelp home page GithubHelp logo

Comments (11)

solojavier avatar solojavier commented on May 18, 2024

Hi @MrYsLab,

It's currently not possible to create a device on the fly as you mention since a lot of things would be needed to be considered... (like what happens if the user doesn't supply enough info, what if the driver isn't present, etc)

But you could do something like this:

  1. Create an api that would listen for the request to create the robot...
  2. When you receive the request, creates the robot with the appropiate devices and pins
  3. Registers the robot
  4. Starts the robot work

Let us know if that work for you or if you have any further questions..

from cylon.

MrYsLab avatar MrYsLab commented on May 18, 2024

Thanks for getting back to me. Some questions:

I am not clear how this would work. Am I gathering the information about devices and pins from the user and then using that information to create a cylon api file and executing that file to create and start the robot, or am I gathering the information and using cylon api calls to create the robot?

To give you a better understanding of what I am trying to do, I want to use Cylon.js to build the second generation of s2a_fm to handle more than just arduinos and also allow the controllers to communicate with each other. Cylon seems to be the perfect answer (with a little added code on my end). If you go to the link above, you will get a short description of what s2a_fm does and if you scroll to the middle of the page, you will see a screenshot of the Scratch graphical programming blocks that s2a_fm provides for the user.

s2a_fm has thousands of users world wide, and I really want to be able to offer my users a unified way of communicating with other devices, such as Raspberry Pi and BeagleBone Black in addition to Arduinos.

Currently I am maintaining an extended version of StandardFirmata called FirmataPlus to offer support for devices that are not supported in StandardFirmata. I would love to standardize on Cylon.js. I could then use all of the devices offered by Cylon and when I want to add a new device, make it Cylon compatible and offer it back to the Cylon community.

Thanks.

from cylon.

solojavier avatar solojavier commented on May 18, 2024

Hi @MrYsLab , just check s2a_fm, congratulations it looks awesome :) and it's great you want to create this second generation of it....

Now about your question it more like you say: "gathering the information about devices and pins from the user and then using that information to create a cylon api file", since Cylon doesn't support api calls to create a robot right now...

Please keep us updated on this project and let us know if you need anything from us, we are in #cylon irc channel too...

from cylon.

edgarsilva avatar edgarsilva commented on May 18, 2024

@MrYsLab you do not need to create a file, you just need to create a server using node.js receive the api calls there and then create the robots inside the server response block and start the work, much as you would with any other cylon.js program, but inside the server response.

from cylon.

MrYsLab avatar MrYsLab commented on May 18, 2024

Thanks. Just to make sure I understand, once a robot is created and start is invoked, the robot configuration is now "fixed" and additional devices cannot be added. Is that true?

Also, is there an easy way to use websockets instead of http in the api?

from cylon.

edgarsilva avatar edgarsilva commented on May 18, 2024

For the time being yes, but we will add that functionality to add devices afterwards.

@stewart might be able to answer the websockets API question more accurately. @stewart what do you think?

from cylon.

stewart avatar stewart commented on May 18, 2024

@MrYsLab by "websockets" do you mean HTTPS? If so, yes, by default (no parameters) Cylon.api() will create a HTTPS server on port 3000. It uses a self-signed cert, but you can provide your own like this:

Cylon.api({
  ssl: {
    key: "/path/to/ssl/cert.key",
    cert: "/path/to/ssl/cert/crt"
  }
});

from cylon.

MrYsLab avatar MrYsLab commented on May 18, 2024

Hi Andrew,
No not https, but websockets. The popular node library that
implements this protocol is socket.io.

Alan

On 08/11/2014 04:40 PM, Andrew Stewart wrote:

@MrYsLab https://github.com/MrYsLab by "websockets" do you mean
HTTPS? If so, yes, by default (no parameters) |Cylon.api()| will
create a HTTPS server on port 3000. It uses a self-signed cert, but
you can provide your own like this:

Cylon.api({
ssl: {
key: "/path/to/ssl/cert.key",
cert: "/path/to/ssl/cert/crt"
}
});


Reply to this email directly or view it on GitHub
#219 (comment).

from cylon.

deadprogram avatar deadprogram commented on May 18, 2024

Actually socket.io is more than just plain old websockets. It adds additional envelope info that is not supported out of the box by other more conventional websockets implementations.

from cylon.

stewart avatar stewart commented on May 18, 2024

Since the connection isn't two-way, nor need it be real-time (for the most part), WebSockets isn't a good fit for the Cylon API. We previously used it for event data, but have since switched to use Server-Sent Events.

For more information, see the Device Events section of the API sec.

from cylon.

MrYsLab avatar MrYsLab commented on May 18, 2024

Thanks guys, I appreciate all your input. My application needs seem to be outside the realm of Cylon, so, I will close my comment.

Alan

from cylon.

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.