Git Product home page Git Product logo

Comments (5)

takasehideki avatar takasehideki commented on June 20, 2024

(Copied from NervesJP/nerves-devcontainer#5 (comment))

Status on macOS

root@be6d80382017:/workspaces/nerves-devcontainer/test# mix burn 
==> nerves
==> test

Nerves environment
  MIX_TARGET:   rpi4
  MIX_ENV:      dev

** (Mix) Could not auto detect your SD card

This is because Docker container cannot access/detect microSD on host PC. One possible solution is calling fwup on host PC from Docker container. Alternatively, binding microSD device to docker container filesystem. But, are they possible?

from docker-nerves.

takasehideki avatar takasehideki commented on June 20, 2024

(Copied from NervesJP/nerves-devcontainer#5 (comment))

status on windows:

root@923930b7aad1:/workspaces/nerves-devcontainer/test# mix burn 
==> nerves
==> test

Nerves environment
  MIX_TARGET:   rpi4
  MIX_ENV:      dev

** (ErlangError) Erlang error: :enoent
    (nerves 1.7.0) lib/nerves/port.ex:88: Nerves.Port.validate("cmd.exe", ["/c", "echo %TEMP%"], [])
    (nerves 1.7.0) lib/nerves/port.ex:25: Nerves.Port.do_cmd/4
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:94: Nerves.Utils.WSL.get_temp_file_location/1
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:237: Nerves.Utils.WSL.make_file_accessible/3
    (nerves 1.7.0) lib/mix/tasks/burn.ex:66: Mix.Tasks.Burn.run/1
    (mix 1.11.2) lib/mix/task.ex:394: Mix.Task.run_task/3
    (mix 1.11.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2

This is because current Nerves supports (native) WSL2 environment for Windows users. We may modify Nerves environment to resolve this situation.
The way to detect whether a container is based on WSL2 or native docker is uname -r and ls /.dockerenv
Ref: https://github.com/ETrobocon/etrobo/blob/master/scripts/etroboenv.sh#L55

from docker-nerves.

takasehideki avatar takasehideki commented on June 20, 2024

@jasonmj suggested the useful information on ElixirForum.
https://elixirforum.com/t/nerves-development-environment-with-docker-and-vs-code/35973/3

When the host is Linux, I've surely checked this method works well.
However, I've also found it is not possible to pass through a USB device (or a serial port) to a container as it requires support at the hypervisor level both in Windows and macOS as the host.

I've added these info to README at 0a0262d

from docker-nerves.

takasehideki avatar takasehideki commented on June 20, 2024

I also found an alternative way to use docker-machine and VirtualBox to pass through devices.
https://christopherjmcclellan.wordpress.com/2019/04/21/using-usb-with-docker-for-mac/

However, this operation is complicated and unacceptable as a guide for beginners.

from docker-nerves.

takasehideki avatar takasehideki commented on June 20, 2024

(Copied from NervesJP/nerves-devcontainer#5 (comment))

status on windows:

root@923930b7aad1:/workspaces/nerves-devcontainer/test# mix burn 
==> nerves
==> test

Nerves environment
  MIX_TARGET:   rpi4
  MIX_ENV:      dev

** (ErlangError) Erlang error: :enoent
    (nerves 1.7.0) lib/nerves/port.ex:88: Nerves.Port.validate("cmd.exe", ["/c", "echo %TEMP%"], [])
    (nerves 1.7.0) lib/nerves/port.ex:25: Nerves.Port.do_cmd/4
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:94: Nerves.Utils.WSL.get_temp_file_location/1
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:237: Nerves.Utils.WSL.make_file_accessible/3
    (nerves 1.7.0) lib/mix/tasks/burn.ex:66: Mix.Tasks.Burn.run/1
    (mix 1.11.2) lib/mix/task.ex:394: Mix.Task.run_task/3
    (mix 1.11.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2

This is because current Nerves supports (native) WSL2 environment for Windows users. We may modify Nerves environment to resolve this situation.
The way to detect whether a container is based on WSL2 or native docker is uname -r and ls /.dockerenv
Ref: https://github.com/ETrobocon/etrobo/blob/master/scripts/etroboenv.sh#L55

This has been fixed at #2
The situation on Windows is now same as on macOS.

from docker-nerves.

Related Issues (2)

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.