Giter VIP home page Giter VIP logo

hello_poncho's Introduction

The content of this file is adopted from nerves-project/nerves_examples.

Hello Poncho

This example demonstrates a basic poncho project for deploying a Phoenix Framework-based application to a Nerves device. A "poncho project" is similar to an umbrella project except that it's actually multiple separate-but-related Elixir apps that use path dependencies instead of in_umbrella dependencies. You can read more about the motivations behind this concept on the embedded-elixir blog post about Poncho Projects.

Hardware

This example serves a Phoenix-based web page over the network. The steps below assume you are using a Raspberry Pi Zero, which allows you to connect a single USB cable to the port marked "USB" to get both network and serial console access to the device. By default, this example will use the virtual Ethernet interface provided by the USB cable, assign an IP address automatically, and make it discoverable using mDNS (Bonjour). For more information about how to configure the network settings for your environment, including WiFi settings, see the vintage_net documentation.

How to Use this Repository

  1. Connect your target hardware to your host computer or network as described above

  2. Prepare your Phoenix project to build JavaScript and CSS assets:

    # These steps only need to be done once.
    cd hello_poncho_ui
    mix deps.get
    npm install --prefix assets
  3. Build your assets and prepare them for deployment to the firmware:

    # Still in hello_poncho_ui directory from the prior step.
    # These steps need to be repeated when you change JS or CSS files.
    npm install --prefix assets --production
    npm run deploy --prefix assets
    mix phx.digest
  4. Change to the hello_poncho_firmware app directory

    cd ../hello_poncho_firmware
  5. Specify your target and other environment variables as needed:

    export MIX_TARGET=rpi0
    # If you're using WiFi:
    # export WIFI_SSID=your_wifi_name
    # export WIFI_PSK=your_wifi_password
  6. Get dependencies, build firmware, and burn it to an SD card:

    mix deps.get
    mix firmware
    mix firmware.burn
  7. Insert the SD card into your target board and connect the USB cable or otherwise power it on

  8. Wait for it to finish booting (5-10 seconds)

  9. Open a browser window on your host computer to http://nerves.local/

  10. You should see a "Welcome to Phoenix!" page

Learn More

hello_poncho's People

Contributors

mnishiguchi avatar

Stargazers

 avatar

Watchers

 avatar  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.