Git Product home page Git Product logo

driver-rubix-compute-io's Introduction

nubeio-rubix-lib-pi-gpio-go

cmd/cli usage

see https://github.com/NubeIO/nubeio-rubix-lib-rest-go/tree/master/pkg/nube/rubixio/cmd#rubix-io-rest-client

to start

Needs to run as root for the PWMs to work

go build app.go && sudo ./app

api

write one as GET (this should just be used for the developer)

value from 0-100, for the 2x DOs 0=off 100=on

GET

http://0.0.0.0:5001/api/outputs/UO1/1

write all

Write all outputs at once (value from 0-100, for the 2x DOs 0=off 100=on)

http://0.0.0.0:5001/api/outputs/all/VALUE

bulk write

POST

http://0.0.0.0:5001/api/outputs/bulk

BODY Options for io_num ("UO1", "UO2", "UO3", "UO4", "UO5", "UO6", "DO1", "DO1")

[
  {
    "IONum":"UO1",
    "value":22.2
  },
  {
    "IONum":"UO2",
    "value":22.2
  }
]

write one

Write on at a time (value from 0-100, for the 2x DOs 0=off 100=on)

POST

http://0.0.0.0:5001/api/outputs

BODY Options for io_num ("UO1", "UO2", "UO3", "UO4", "UO5", "UO6", "DO1", "DO1")

{
    "io_num": "UO1",
    "value": 100
}

Get all input values

http://0.0.0.0:5001/api/inputs/all

pigpio

sudo apt-get install pigpio

to start for dev

sudo pigpiod

auto start

/lib/systemd/system/pigpiod.service

sudo systemctl enable pigpiod
sudo systemctl edit --full pigpiod
sudo systemctl reload-or-restart pigpiod

ExecStart=/usr/bin/pigpiod -l -n 127.0.0.1 to open the soket

[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -l -n 127.0.0.1
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target

enable hardware PWM (UO3 and UO6 only)

sudo nano /boot/config.txt

add this in

dtoverlay=pwm-2chan

On the Raspberry Pi, add dtoverlay=pwm-2chan to /boot/config.txt. This defaults to GPIO_18 as the pin for PWM0 and GPIO_19 as the pin for PWM1. Alternatively, you can change GPIO_18 to GPIO_12 and GPIO_19 to GPIO_13 using dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4. Reboot your Raspberry Pi. You can check everything is working on running lsmod | grep pwm and looking for pwm_bcm2835

fix the 485 on the rubix-io

https://www.instructables.com/Raspberry-PI-3-Enable-Serial-Communications-to-Tty/

the bluthooth needs to be disabled on the PI

sudo nano /boot/config.txt

add this in

dtoverlay=disable-bt

driver-rubix-compute-io's People

Contributors

nubedev avatar raibnod avatar

Watchers

 avatar  avatar

driver-rubix-compute-io's Issues

Issue on i2c results

what py reads
[245, 88, 249, 109, 241, 6, 240, 0, 240, 0, 240, 0, 240, 0, 240, 0]

what go reads
[248 213 255 255 240 0 240 0 240 0 240 1 240 1 240 8]

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.