Giter Club home page Giter Club logo

koruza-pi's Introduction

#Koruza Pi

This is a KORUZA package for Raspberry Pi (user interface, measurements data collection, controller).

Check repository koruza-instructions if you are looking for documentation on how to assemble and use Koruza system. See project website for complete specification and introduction.

Should you need any support with KORUZA system, get in touch with Institute IRNAS team and others involved in the project via chat or forum.


Installation

Requirements

Raspberry Pi 2B running Raspberry Jesse system and KORUZA RPi shield. Copy the system to an SD card and boot the RPi and install the system.

From Git repository

To install the latest version directly from the repository do the following on the Raspberry Pi running Raspbian:

$ git clone https://github.com/IRNAS/koruza-pi
$ cd koruza-pi
$ sudo ./install.sh

Manual

First, prepare an installation package from this repository by running:

$ ./make-package.sh

This will give you a file koruza-package.tar.bz2, which you should copy to the Raspberry Pi running KORUZA. You can do this by using scp. After the file has been copied, connect to the Raspberry Pi and execute the following commands:

$ sudo tar -xf koruza-package.tar.bz2 -C /
$ sudo /koruza/install

And this should install and configure all the needed services.

Upgrade

To upgrade an existing installation, copy over the package as above and then run:

$ sudo /koruza/upgrade koruza-package.tar.bz2

Upgrade to the latest version

To upgrade an existing installation to the latest version from the GitHub repository, simply run:

$ sudo /koruza/upgrade

Debugging the KORUZA IPC bus

The IPC bus has two endpoints:

  • /tmp/koruza-publish.ipc is used for publishing status updates about all controlled devices.

  • /tmp/koruza-command.ipc is used for issuing commands to devices.

The following command may be used to inspect the data that is currently being published by the koruza-sensors controller:

$ sudo nanocat --sub --connect-ipc /tmp/koruza-publish.ipc --ascii

If everything is working correctly, you should see a stream of messages of the following form:

status@{"type": "motors", "motor": {"current_f": 0, "flash_write_count": 34, "next_x": 150, "next_y": 200, "status_f": 0, "accel": 1000, "command": 0, "empty": 255, "status_y": 16, "status_x": 0, "laser": 0, "next_f": 0, "flash_status": 171, "speed": 1000, "current_y": 210, "current_x": 150}}
status@{"type": "sfp", "sfp": {"150918": {"temperature_c": 44.8671875, "tx_power_mw": 0.5691, "tx_bias_ma": 34.462, "rx_power_mw": 0.0, "vcc_v": 3.2437}}}
process@{"type": "watchdog", "time": 1445805609.989954}
status@{"type": "motors", "motor": {"current_f": 0, "flash_write_count": 34, "next_x": 150, "next_y": 200, "status_f": 0, "accel": 1000, "command": 0, "empty": 255, "status_y": 16, "status_x": 0, "laser": 0, "next_f": 0, "flash_status": 171, "speed": 1000, "current_y": 210, "current_x": 150}}

Each message consists of two parts separated by an @ character. The first part is the topic and the second part is the JSON payload.

To transmit commands you may also leverage the nanocat utility by doing the following:

$ sudo nanocat --req --connect-ipc /tmp/koruza-command.ipc --ascii --data '{"type": "command", "command": "motor_move", "next_x": 150, "next_y": 200, "next_f": 0}'
{"status": "ok", "type": "cmd_reply"}

License

All our projects are as usefully open-source as possible.

Hardware including documentation is licensed under CERN OHL v.1.2. license

Firmware and software originating from the project is licensed under GNU GENERAL PUBLIC LICENSE v3.

Open data generated by our projects is licensed under CC0.

All our websites and additional documentation are licensed under [Creative Commons Attribution-ShareAlike 4 .0 Unported License] (https://creativecommons.org/licenses/by-sa/4.0/legalcode).

What this means is that you can use hardware, firmware, software and documentation without paying a royalty and knowing that you'll be able to use your version forever. You are also free to make changes but if you share these changes then you have to do so on the same conditions that you enjoy.

Koruza, GoodEnoughCNC and IRNAS are all names and marks of Institut IRNAS Rače. You may use these names and terms only to attribute the appropriate entity as required by the Open Licences referred to above. You may not use them in any other way and in particular you may not use them to imply endorsement or authorization of any hardware that you design, make or sell.

koruza-pi's People

Contributors

anjala avatar eva-cerncic avatar kostko avatar slomusti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

koruza-pi's Issues

Device name should change hostname and dns broadcast

Device name in settings should change the hostname of the device to whichever one is set and change the dns broadcast, such that it works by .local allowing for multiple units to co-exist on the same network

Implement data loggin to SD card

Implement a mechanism for storing raw measurements collected every 50ms to SD card. For conserving space, capture/log interval for every variable on the bus should be defined separately, namely:

RX power in mW to be logged with as fast as possible, for others averaging may be suitable.

Build not reproducible into a working state

I tried to build koruza-pi and ran into the following issues:

  • raspbian versions from jessie onwards do not make use of the watchdog anymore but rely on systemd. The commands have changed, too, breaking the installation routine
  • the python cryptography package requires updating setuptools prior to installation

I intend to rewrite the installation routine to work with newer raspbian editions, however I am currently not even able to bring the koruza unit into a working state. Upon startup

  • the status LED blinks

  • no connection is established to the motor boards

  • manually subscribing to the IPC endpoints only yields the watchdog messages, nothing more. Trying to write to the command endpoint results in an error (see below).

  • manually stopping all services and setting the LED GPIOs high/low does not result in any LEDs lighting up other than the status LED

    sudo nanocat --req --connect-ipc /tmp/koruza-command.ipc --ascii --data '{"type": "command", "command": "motor_move", "next_x": 150, "next_y": 200, "next_f": 0}'
    {"message": "Motor not present.", "code": 400, "type": "cmd_error"}

I2C bus hang after some time

I2c bus appears to hang on certain devices after some time. The reset implemented in koruza-gpio appears to be insufficient to power down the motor controller and media converter as only complete device power-cycle fixes the problem.

A possible reason is parasite powering of UniversalUnipolarStepperController through UART interface RX pin and thus a fix for this should be included in the reset.

Add green-lasr blink function

Add a function that will blink the green laser, for example 5s on during 60s period and user can specify during what times of the day that happens.

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.