crispinb
How to create Nerves image under wsl2
I thought I’d give Nerves a spin (to follow along with Build a Weather Station with Elixir and Nerves (PragProg)) but have thus far fallen at the first hurdle.
I’m doing all this under Windows 10, wsl2. I’ve managed to build the firmware but can’t burn it. Because of the oddities of how wsl2 accesses block devices (via p9) I gave up trying to write direct to the device. If I can just create the firmware image, that’s easy enough to get onto the SD card.
The mix burn help suggests I can create such an image, via mix burn --device <filename>, but that nets this error:
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ Start-Process fwup -Verb runAs -Wait -ArgumentList "-a -i \\wsl$\Ubun ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
That’s obviously powershell output, so I thought as all I’m trying to do here is write to a file it might be simpler to use the linux fwup (which I also have installed). So I removed the windows fwup.exe from my path, and now I get:
❯ mix burn --device ./image.img
==> nerves
==> sensor_hub
Nerves environment
MIX_TARGET: rpi0
MIX_ENV: dev
** (Mix) fwup.exe is required by the Nerves tooling.
Please see https://hexdocs.pm/nerves/installation.html for installation
instructions.
Can I force mix burn to allow me to use the linux fwup so I can just write to a local filesystem image?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security










Marked As Solved
crispinb
Ok this is embarrassing -
mix burndoes work perfectly well with a manually-installed fwup.exe after all. I had a quick look at the chocolatey package - it doesn’t do anything substantially different from just plopping the .exe in the path, so I realised I must have done something daft. Which indeed I had - I had put fwup.exe in a directory that used to be on the path on my machine, but was no longer.PEBKAC.
Also Liked
03juan
I remember also banging my head around this issue and just decided to take the plunge with chocolatey as a last resort which worked. Also agree about having to juggle multiple tools but in this case this was the easiest way that let me just get on with it.
I think the main issue is that you can’t have direct access to the usb subsystem from wsl2, but I don’t know why we both had a hard time with the manual exe install.
Perhaps with some more time I’d revisit the subject and try to solve the issue once and for all using the manual way, and write a post about it for others.
03juan
that’s what I did on my router because mDNS didn’t pick up the device when not connected via USB gadget mode
I must have messed up my paths as well, will have to check when I get a chance. Thanks for persevering to the root cause