• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to use relay?

    Scheduled Pinned Locked Moved Unipi Neuron
    4 Posts 3 Posters 3.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alessandro
      last edited by

      Re: Problems switching a relay

      Hi,
      I'm starting to program my new UniPi from netBeans. (installed on a Windows PC) My questions are the following:
      -How can I control the relay?
      -Do I need a specific library?

      Thanks,

      Alessandro.

      T 1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators @Alessandro
        last edited by

        Hello @Alessandro,

        if you install default raspbian, then we provide TCP Modbus interface for all IOs except 1Wire communication. This has to be solved in a different way for example owfs.

        Or you can also use Evok which is in beta support for Neurons which provides additional APIs (websocket, REST api,...)

        https://github.com/UniPiTechnology/neuron_tcp_modbus_overlay

        https://github.com/UniPiTechnology/evok

        1 Reply Last reply
        Reply Quote 0
        • A
          Alessandro
          last edited by

          First of all thank you for your fast answer. I'll give you some more details in order to let you understand better my problem:
          I installed the RASPBIAN JESSIE WITH DESKTOP on the UniPi and I'm moving the first steps in the programming. I connected the uniPi to my network. I installed netBeans on my windows PC and the library lbcm2835 to control the I/O. I realized the first "hello world" program in c++ that works well.
          Now I don't know (and I don't find any information on the web) wich command has to be used to activate the relay. This is the reason I'm asking you for.
          Thank you one more time,
          Alessandro.

          S 1 Reply Last reply
          Reply Quote 0
          • S
            stephamd @Alessandro
            last edited by

            @Alessandro
            lbcm2835 is used to access I/O pins on the Pi. UniPis do not use GPIO to handle output. There are internal ARM processors which are connected to the Pi via an SPI bus that handle the system's IO. The easiest way to access the relays would be to install the neuron tcp modbus overlay as stated above and access the relays through a c++ modbus library.

            1 Reply Last reply
            Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post