Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Welcome to Nerves Livebook

priv/welcome.livemd

Welcome to Nerves Livebook

Introduction

Thanks for trying out Nerves Livebook!

With this Livebook image, you can work through tutorials, create your own code notebooks and save them on device, and import notebooks from others. We’re just getting started and are super excited with what Livebook can already do. We hope that you’ll enjoy learning about embedded systems and working with hardware in the notebook environment too!

Getting started

You’ve already figured out how to install the Nerves Livebook to your device and how to open this file, so you’re well on your way!

The next steps are to try out the notebooks in the samples directory. They’re all read-only so you’ll need to fork them just like you did to open this file. Livebook and Nerves Livebook are rapidly evolving so some notebooks are a work-in-progress. We recommend starting with the following:

  • Configure WiFi - connect to a WiFi access point
  • LEDs - learn about the built-in LEDs on your device
  • VintageNet - learn about networking on Nerves devices
  • Firmware Update - download the latest Nerves Livebook firmware

Saving and copying files

This file and the samples are read-only since they’re built into Nerves Livebook. Your files can be saved anywhere in /data which is writable like a drive on your computer. Firmware updates using the firmware_update.livemd won’t erase your files. Be careful, though, if you remove the MicroSD card and re-initialize it in your computer. That will erase them.

If you want to copy a file off the Nerves Livebook image, open up a shell on your computer and run sftp livebook@nerves.local. The password is nerves. Once you’re logged in, navigate to /data/livebook or where ever you stored your files and run get to copy them off.

Limitations

If you’ve used Livebook before, the Nerves Livebook image has a few differences:

  1. All code gets evaluated in one Erlang VM. This is convenient for Nerves devices, but you may be surprised when a module defined in one notebook is then accessible in another.
  2. Installing hex dependencies is not supported. Nerves Livebook includes many libraries as a convenience, though. We still recommend using Mix.install/1 to document what dependencies your notebook requires, but if the dependency is not already loaded, it will raise an error.

Pre-installed libraries

Since you cannot install libraries through hex, we include the libraries listed below.

If there is a dependency you want to see included in the nerves_livebook distribution, please file an issue or make a PR to include new libraries in the main image.

  • Kino, interactive widgets for Livebook
  • VegaLite, Elixir bindings for the interactive graphic library Vega-Lite (supported by Kino)
  • Phoenix.PubSub, a realtime publisher/subscriber service
  • Circuits.UART, allowing you to use UARTs, serial ports, Bluetooth virtual serial port connections and more
  • Circuits.GPIO, letting you control or read from GPIOs
  • Circuits.I2C, letting you communicate with hardware devices using the I2C protocol
  • Circuits.Spi, providing high level abstractions for interfacing to SPI busses
  • NervesKey, tools for interacting with Nerves hardware security modules (HSMs)
  • Pigpiox, a wrapper around the the pigpio library for driving GPIO pins
  • RamoopsLogger, a Logger backend for forwarding to a ramoops in the event of a system crash
  • BMP280, support for the Bosch BMP180, BMP280, BME280, and BME680 temperature/pressure sensors
  • ScrollHat, a driver for Pimoroni Scroll Hat LED boards
  • InputEvent, an interface to Linux input event devices such as keyboards, joysticks, mice, touchscreens, etc
  • Nx, a multi-dimensional tensors library with CPU/GPU support
  • BlueHeron, for communicating with Bluetooth LE modules via HCI
  • BlueHeron.HCI.Transport.UART, UART support for BlueHeron
  • NervesTimeZones, local time and time zone support for Nerves devices

Learn more