Git Product home page Git Product logo

colorlite's Introduction

                                     _____     __         __   _ __
                                    / ___/__  / /__  ____/ /  (_) /____
                                   / /__/ _ \/ / _ \/ __/ /__/ / __/ -_)
                                   \___/\___/_/\___/_/ /____/_/\__/\__/
                                     Copyright (c) 2020-2022, EnjoyDigital
                                             Powered by LiteX

License

[> Intro

This small project is an attempt to use a $15 FPGA board to do some remote control/monitoring over an Ethernet network. It can be convenient to power on/power off systems remotely and/or do some monitoring. This has been created in this strange COVID-19 period to avoid moving all the lab equipment to home and ease remote work, but this is also a practical example of a very simple LiteX SoC built with full open-source tools. Similar things can be easily done with Arduino, Rapsberry Pi, ESP32 for almost the same price or even cheaper but here the fun is to use our tools for that... and maybe extend this project to something more powerful in the future (Remote logic analyzer with 1Gbps link? :)).

[> Prerequisites

  • Yosys/Nextpnr ECP5 toolchain installed.
  • An OpenOCD compatible JTAG cable.
  • A ColorLight 5A-75B board (can be found on Amazon/eBay/AliExpress/...).
  • A USB charger and USB cable that can be cut to power the board on the 5V/GND connector.

[> Installing LiteX

$ wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
$ chmod +x litex_setup.py
$ sudo ./litex_setup.py init install

[> Build and Flash the bitstream

$ ./colorlite.py --ip-address=192.168.1.20 --flash

[> Open LiteX server

$ litex_server --udp --udp-ip=192.168.1.20

[> Enjoy :)

$ cd scripts
$ ./test_blink.py (will blink the Led)
$ ./test_gpios.py (will toggle the 2 GPIOs)
$ ./test_flash.py (will read the first bytes of the SPI Flash)

In our usecase, we use a two channel relay module that can be easily found on Amazon/eBay/AliExpress to emulate the power and reboot switch of a computer:

  • In1 is connected to J4/R0 HUB75 connector of the FPGA board and Relay1 is emulating the power switch.
  • In2 is connected to J4/G0 HUB75 connector of the FPGA board and Relay2 is emulating the reboot switch.

We then easily control the power off/on, reboot of a computer with:

$ ./test_power_on.py (will do a short pulse on power switch)
$ ./test_gpios.py (will do a short long pulse on power switch)
$ ./test_flash.py (will do a short pulse on reboot switch)

Note: It is recommended to operate this on a local network. It's possible to expose/use it over Internet through a Router but the protocol is not secured at all, so don't use it to control sensitive equipments or at your own risk!

End of the tutorial, time to power off! :)

colorlite's People

Contributors

enjoy-digital avatar stottsc avatar

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.